Calling Javascript Function from within VB Procedure?

Discussion in 'ASP .Net' started by Martin, Mar 1, 2004.

  1. Martin

    Martin Guest

    Dear Group

    I'm using VB to write an aspnet application. I would like to call a
    javascript function from within a VB Sub or VB Function, is it
    possible? My code is something like this:

    VB Code:
    Public Sub VBProcedure()
    ..
    ..
    Run some VB Code...
    ..
    ..
    Now call the javascript function

    End Sub
    ------------------------------------------------------
    Javascript:
    <HEAD>
    <script language=javascript>
    <!--
    // MyFunction
    function myfunction() {
    window.open()
    }
    //-->
    </script>
    </HEAD>

    I tried javascript: myfunction() within the VB procedure. Well, it was
    just a blind guess since the 'javascript:' syntax did not produce any
    errors. What is 'javascript:' all about? I can't find it documented.

    Thanks for your help & efforts!

    Martin
     
    Martin, Mar 1, 2004
    #1
    1. Advertising

  2. Use Page.RegisterClientScriptBlock("", "your javascript code as string") method

    Visit the following link for details on RegisterClientScriptBlock method
    http://msdn.microsoft.com/library/d...bUIPageClassRegisterClientScriptBlockTopic.as

    Suresh


    ----- Martin wrote: ----

    Dear Grou

    I'm using VB to write an aspnet application. I would like to call
    javascript function from within a VB Sub or VB Function, is i
    possible? My code is something like this

    VB Code
    Public Sub VBProcedure(
     
    =?Utf-8?B?U3VyZXNo?=, Mar 1, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markusek Peter

    calling javascript function within <TABLE> tags

    Markusek Peter, Feb 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    7,658
    ajaymehra
    Feb 9, 2004
  2. Mike P
    Replies:
    0
    Views:
    3,307
    Mike P
    Jun 19, 2006
  3. Replies:
    1
    Views:
    272
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Apr 5, 2007
  4. AlexWare
    Replies:
    2
    Views:
    761
    Paul Uiterlinden
    Oct 23, 2009
  5. ab
    Replies:
    7
    Views:
    259
    J. Gleixner
    Nov 27, 2007
Loading...

Share This Page