Re: How to include JavaScript in .aspx page

Discussion in 'ASP .Net' started by Alvin Bruney [MVP], Sep 22, 2004.

  1. use an include file

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "Joe" <> wrote in message
    news:...
    > Hi,
    >
    > I have a lot of JavaScript (about 90-100 lines) that I want to include in
    > the .aspx page. Can someone tell me what would be the most efficient way
    > to
    > do it? I am using VB.NET.
    >
    > Thanks,
    >
    > Joe
    >
     
    Alvin Bruney [MVP], Sep 22, 2004
    #1
    1. Advertising

  2. I need to call a Javascript finction when a user clicks on Submit button. In
    the Submit button I am already using OnClick to call a VB sub that resides in
    the code-behind file.

    If I use the <script language="JavaScript" src="somefile.js"></script> to
    include all my Javascript, how do I call a Javascript function then since I
    am using OnClick to call a Sub.

    Joe



    "Alvin Bruney [MVP]" wrote:

    > use an include file
    >
    > --
    > Regards,
    > Alvin Bruney
    > [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    > Got tidbits? Get it here... http://tinyurl.com/27cok
    > "Joe" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I have a lot of JavaScript (about 90-100 lines) that I want to include in
    > > the .aspx page. Can someone tell me what would be the most efficient way
    > > to
    > > do it? I am using VB.NET.
    > >
    > > Thanks,
    > >
    > > Joe
    > >

    >
    >
    >
     
    =?Utf-8?B?Sm9l?=, Sep 22, 2004
    #2
    1. Advertising

  3. You can not call javascript from a vbscript method. (or atleast I haven't
    found it.)

    I have a work around, it works, but might be the long way around, any other
    ideas should post, I might change my implementation of it.

    My vbscript calls the click method of a hidden control. The hidden
    control's click handler calls javascript.

    <input type="button" id="btnSubmit" name="btnSubmit" value="Submit" />
    sub btnSubmit_OnClick()
    ' do stuff
    document.all( "ctlCrossClick" ).click()
    end sub

    <input type="button" onclick="javascript: myJavascriptMethod()"
    style="display: none;" />

    function myJavascriptMethod()
    {
    //do stuff.
    }

    HTH,

    bill

    "Joe" <> wrote in message
    news:...
    > I need to call a Javascript finction when a user clicks on Submit button.

    In
    > the Submit button I am already using OnClick to call a VB sub that resides

    in
    > the code-behind file.
    >
    > If I use the <script language="JavaScript" src="somefile.js"></script> to
    > include all my Javascript, how do I call a Javascript function then since

    I
    > am using OnClick to call a Sub.
    >
    > Joe
    >
    >
    >
    > "Alvin Bruney [MVP]" wrote:
    >
    > > use an include file
    > >
    > > --
    > > Regards,
    > > Alvin Bruney
    > > [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    > > Got tidbits? Get it here... http://tinyurl.com/27cok
    > > "Joe" <> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > I have a lot of JavaScript (about 90-100 lines) that I want to include

    in
    > > > the .aspx page. Can someone tell me what would be the most efficient

    way
    > > > to
    > > > do it? I am using VB.NET.
    > > >
    > > > Thanks,
    > > >
    > > > Joe
    > > >

    > >
    > >
    > >
     
    William F. Robertson, Jr., Sep 22, 2004
    #3
    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. AV
    Replies:
    1
    Views:
    2,642
    HrtgSkr
    Aug 7, 2003
  2. Mr. x
    Replies:
    1
    Views:
    1,987
    John Timney \(Microsoft MVP\)
    Nov 30, 2003
  3. =?Utf-8?B?Sm9l?=

    How to include JavaScript in .aspx page

    =?Utf-8?B?Sm9l?=, Sep 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    496
    =?Utf-8?B?Sm9l?=
    Sep 22, 2004
  4. uto
    Replies:
    3
    Views:
    707
    Michael Hamrah
    Mar 8, 2006
  5. Andreas Bogenberger
    Replies:
    3
    Views:
    960
    Andreas Bogenberger
    Feb 22, 2008
Loading...

Share This Page