Calling Javascript function

Discussion in 'ASP .Net' started by Krishna, Jul 7, 2003.

  1. Krishna

    Krishna Guest

    Hi all,

    Can i call my javascript functions from the web controls.Any appropriate
    site which will be tell more on this will be helpfull.

    Regards..,
    Krishna
     
    Krishna, Jul 7, 2003
    #1
    1. Advertising

  2. Krishna

    Teemu Keiski Guest

    I have discussed about similar feature on ASP.NET Forums:
    http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=267756

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi

    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com

    Email:


    "Krishna" <> wrote in message
    news:...
    > Hi all,
    >
    > Can i call my javascript functions from the web controls.Any appropriate
    > site which will be tell more on this will be helpfull.
    >
    > Regards..,
    > Krishna
    >
    >
     
    Teemu Keiski, Jul 7, 2003
    #2
    1. Advertising

  3. JavaScript executes on the client side. It is sent to the client as
    scripting embedded in the HTML of a page. Therefore, you cannot interact
    directly with JavaScript on the server side. You CAN, however, add
    JavaScript to a page on the server, which will execute when the page loads
    in the browser. You can do this by using the
    Page.RegisterClientScriptBlock() and Page.RegisterStartupScript() methods.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    http://www.takempis.com
    Some things just happen.
    Everything else occurs.

    "Krishna" <> wrote in message
    news:...
    > Hi all,
    >
    > Can i call my javascript functions from the web controls.Any appropriate
    > site which will be tell more on this will be helpfull.
    >
    > Regards..,
    > Krishna
    >
    >
     
    Kevin Spencer, Jul 7, 2003
    #3
  4. Krishna

    pat sinnott Guest

    Hi

    I don't actually think it is this complicated.

    You call use Javascript with server side controls exactly
    as you use it with normal clientside HTML controls. There
    are however a few caveats.

    If the name of a server side event clashes with the name
    of the client side event this will lead to a problem.
    So for instance if you are programming javascript against
    a webform button control you will need to use the
    onMousedown client side event rather than the onclick
    event as the there is an event named onclick on the server
    side.

    You will have no intellisense when you write the
    javascript code against the server side controls as these
    controls do not actually exist till they are rendered as
    HTML when the application executes.
    Also when referencing the control reference it as
    document.all rather than document.Form1, I have sometimes
    had problems with the latter syntax.

    Regards,

    Pat Sinnott MCSD


    >-----Original Message-----
    >JavaScript executes on the client side. It is sent to the

    client as
    >scripting embedded in the HTML of a page. Therefore, you

    cannot interact
    >directly with JavaScript on the server side. You CAN,

    however, add
    >JavaScript to a page on the server, which will execute

    when the page loads
    >in the browser. You can do this by using the
    >Page.RegisterClientScriptBlock() and

    Page.RegisterStartupScript() methods.
    >
    >HTH,
    >
    >Kevin Spencer
    >Microsoft FrontPage MVP
    >Internet Developer
    >http://www.takempis.com
    >Some things just happen.
    >Everything else occurs.
    >
    >"Krishna" <> wrote in message
    >news:...
    >> Hi all,
    >>
    >> Can i call my javascript functions from the web

    controls.Any appropriate
    >> site which will be tell more on this will be helpfull.
    >>
    >> Regards..,
    >> Krishna
    >>
    >>

    >
    >
    >.
    >
     
    pat sinnott, Jul 8, 2003
    #4
  5. ?????

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    http://www.takempis.com
    Some things just happen.
    Everything else occurs.

    "pat sinnott" <> wrote in message
    news:89a401c34564$41ad7a00$...
    > Hi
    >
    > I don't actually think it is this complicated.
    >
    > You call use Javascript with server side controls exactly
    > as you use it with normal clientside HTML controls. There
    > are however a few caveats.
    >
    > If the name of a server side event clashes with the name
    > of the client side event this will lead to a problem.
    > So for instance if you are programming javascript against
    > a webform button control you will need to use the
    > onMousedown client side event rather than the onclick
    > event as the there is an event named onclick on the server
    > side.
    >
    > You will have no intellisense when you write the
    > javascript code against the server side controls as these
    > controls do not actually exist till they are rendered as
    > HTML when the application executes.
    > Also when referencing the control reference it as
    > document.all rather than document.Form1, I have sometimes
    > had problems with the latter syntax.
    >
    > Regards,
    >
    > Pat Sinnott MCSD
    >
    >
    > >-----Original Message-----
    > >JavaScript executes on the client side. It is sent to the

    > client as
    > >scripting embedded in the HTML of a page. Therefore, you

    > cannot interact
    > >directly with JavaScript on the server side. You CAN,

    > however, add
    > >JavaScript to a page on the server, which will execute

    > when the page loads
    > >in the browser. You can do this by using the
    > >Page.RegisterClientScriptBlock() and

    > Page.RegisterStartupScript() methods.
    > >
    > >HTH,
    > >
    > >Kevin Spencer
    > >Microsoft FrontPage MVP
    > >Internet Developer
    > >http://www.takempis.com
    > >Some things just happen.
    > >Everything else occurs.
    > >
    > >"Krishna" <> wrote in message
    > >news:...
    > >> Hi all,
    > >>
    > >> Can i call my javascript functions from the web

    > controls.Any appropriate
    > >> site which will be tell more on this will be helpfull.
    > >>
    > >> Regards..,
    > >> Krishna
    > >>
    > >>

    > >
    > >
    > >.
    > >
     
    Kevin Spencer, Jul 8, 2003
    #5
  6. Thanks Pat! You had me lost there!

    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    http://www.takempis.com
    Big things are made up
    of lots of little things

    "Pat Sinnott" <> wrote in message
    news:064401c3461c$fcf15990$...
    > Hi Kevin
    >
    > Sorry I thought the query related to calling javascript
    > functions from the HTML representation of the server
    > control.
    >
    > Pat.
    > >-----Original Message-----
    > >?????
    > >
    > >HTH,
    > >
    > >Kevin Spencer
    > >Microsoft FrontPage MVP
    > >Internet Developer
    > >http://www.takempis.com
    > >Some things just happen.
    > >Everything else occurs.
    > >
    > >"pat sinnott" <> wrote in message
    > >news:89a401c34564$41ad7a00$...
    > >> Hi
    > >>
    > >> I don't actually think it is this complicated.
    > >>
    > >> You call use Javascript with server side controls

    > exactly
    > >> as you use it with normal clientside HTML controls.

    > There
    > >> are however a few caveats.
    > >>
    > >> If the name of a server side event clashes with the name
    > >> of the client side event this will lead to a problem.
    > >> So for instance if you are programming javascript

    > against
    > >> a webform button control you will need to use the
    > >> onMousedown client side event rather than the onclick
    > >> event as the there is an event named onclick on the

    > server
    > >> side.
    > >>
    > >> You will have no intellisense when you write the
    > >> javascript code against the server side controls as

    > these
    > >> controls do not actually exist till they are rendered as
    > >> HTML when the application executes.
    > >> Also when referencing the control reference it as
    > >> document.all rather than document.Form1, I have

    > sometimes
    > >> had problems with the latter syntax.
    > >>
    > >> Regards,
    > >>
    > >> Pat Sinnott MCSD
    > >>
    > >>
    > >> >-----Original Message-----
    > >> >JavaScript executes on the client side. It is sent to

    > the
    > >> client as
    > >> >scripting embedded in the HTML of a page. Therefore,

    > you
    > >> cannot interact
    > >> >directly with JavaScript on the server side. You CAN,
    > >> however, add
    > >> >JavaScript to a page on the server, which will execute
    > >> when the page loads
    > >> >in the browser. You can do this by using the
    > >> >Page.RegisterClientScriptBlock() and
    > >> Page.RegisterStartupScript() methods.
    > >> >
    > >> >HTH,
    > >> >
    > >> >Kevin Spencer
    > >> >Microsoft FrontPage MVP
    > >> >Internet Developer
    > >> >http://www.takempis.com
    > >> >Some things just happen.
    > >> >Everything else occurs.
    > >> >
    > >> >"Krishna" <> wrote in message
    > >> >news:...
    > >> >> Hi all,
    > >> >>
    > >> >> Can i call my javascript functions from the web
    > >> controls.Any appropriate
    > >> >> site which will be tell more on this will be

    > helpfull.
    > >> >>
    > >> >> Regards..,
    > >> >> Krishna
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >> >.
    > >> >

    > >
    > >
    > >.
    > >
     
    Kevin Spencer, Jul 9, 2003
    #6
    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. Silvia Brunet-Jones
    Replies:
    1
    Views:
    408
    Kevin Spencer
    Jul 28, 2003
  2. Silvia Brunet Jones
    Replies:
    0
    Views:
    376
    Silvia Brunet Jones
    Jul 28, 2003
  3. Andreas Lagemann
    Replies:
    8
    Views:
    504
    Mike Wahler
    Jan 10, 2005
  4. tiwy
    Replies:
    0
    Views:
    454
  5. Lisa Calla
    Replies:
    0
    Views:
    289
    Lisa Calla
    Nov 9, 2004
Loading...

Share This Page