calling a javascript function from a vb function

calling a javascript function from a vb function

Post by Marco Jonke » Wed, 13 Jun 2001 17:39:56



I would like to use a messagebox in my aspx page. Erlier in this discussion
I read that I should use clientside javascript to use a messagebox. Now I
would like to know if it is possible to call a javascript function from a
serverside VB function??

Thanks, bey

 
 
 

calling a javascript function from a vb function

Post by Hans Blomm » Thu, 14 Jun 2001 03:17:05


You have to write your function (alert) between <script></script>, without putting it in a function. This will run the javascript immediately after the page gets loaded, displaying the messagebox:

    <html>
        <script>
            alert ('Hello');
        </script>
    </html>

--
Hans Blomme


> I would like to use a messagebox in my aspx page. Erlier in this discussion
> I read that I should use clientside javascript to use a messagebox. Now I
> would like to know if it is possible to call a javascript function from a
> serverside VB function??

> Thanks, bey


 
 
 

calling a javascript function from a vb function

Post by Marco Jonke » Thu, 14 Jun 2001 16:37:24


This is not exactly what I ment. I have an asp.net application. In this application there is a submitbutton. When you click on this submitbutton an VB function running on the server is called. In this function I want to show a dialogbox when a surten error occurs, but I heard it is impossible to show a dialogbox at the client side by calling it in a VB function running at the server and that I should call it in a client site javascript. So I would like to call a clientside javascript from a serverside VB function. Is this possible??

  You have to write your function (alert) between <script></script>, without putting it in a function. This will run the javascript immediately after the page gets loaded, displaying the messagebox:

      <html>
          <script>
              alert ('Hello');
          </script>
      </html>

  --
  Hans Blomme


  > I would like to use a messagebox in my aspx page. Erlier in this discussion
  > I read that I should use clientside javascript to use a messagebox. Now I
  > would like to know if it is possible to call a javascript function from a
  > serverside VB function??
  >
  > Thanks, bey
  >
  >

 
 
 

calling a javascript function from a vb function

Post by Hans Blomm » Thu, 14 Jun 2001 18:19:21


Well, if an error occurs, you'll have to reload the current page and add the JScript.

--
Hans Blomme


  This is not exactly what I ment. I have an asp.net application. In this application there is a submitbutton. When you click on this submitbutton an VB function running on the server is called. In this function I want to show a dialogbox when a surten error occurs, but I heard it is impossible to show a dialogbox at the client side by calling it in a VB function running at the server and that I should call it in a client site javascript. So I would like to call a clientside javascript from a serverside VB function. Is this possible??

    You have to write your function (alert) between <script></script>, without putting it in a function. This will run the javascript immediately after the page gets loaded, displaying the messagebox:

        <html>
            <script>
                alert ('Hello');
            </script>
        </html>

    --
    Hans Blomme


    > I would like to use a messagebox in my aspx page. Erlier in this discussion
    > I read that I should use clientside javascript to use a messagebox. Now I
    > would like to know if it is possible to call a javascript function from a
    > serverside VB function??
    >
    > Thanks, bey
    >
    >

 
 
 

1. I want to call a javascript function WITH parameters function from c#

I want to call a javascript function WITH parameters function from c#
code; I already did this:
....
StartDate.Attributes.Add("onTextChange","DateGreaterThan(" +
StartDate.Value + "," + RequiredByDate.Value + ");");
....
in the control (C# code)

What is the syntax to call the function from asp.net?
this does not work:
<combo:WebDateChooser id="StartDate" runat="server"
onValueChange="DateGreaterThan(Date2, Date1);"></combo:WebDateChooser>

this is the function in javascript:

function DateGreaterThan(Date2,Date1)
{ ....}

2. DBNull to String???

3. How do I call an inline JavaScript function from within my VB code-behind module?

4. Warning: Arachne v1.66 and TEMP=C:\DOS

5. Finding out which function called the currently running function.

6. downloading text files

7. Calling a code-behind function from vbscript function, possible?

8. boot.ini problem

9. Calling a javascript function from code behind

10. How to call JavaSCRIPT Function in axWebBrowser?

11. Can JavaScript call c++ functions defined in an MFC-based browser app?

12. Calling serverside function from Javascript

13. Call javascript function onload event of usercontrol