Declarative Client Side javascript...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Royal

    #1

    Declarative Client Side javascript...

    I know that programmaticall y, one can add attributes for controls that will
    be passed down to the client in html. Example:

    servercontrol1. attributes.add( "onclick", "javascript:fly home()").

    My question is, can this be done declaratively? I'd prefer not to have to
    add code to each of the controls I want to add client side javascript
    attributes for.

    <servercontro l id="duh" onclick="javasc ript:flyhome()" >

    Thanks. This is for ASP.NET 2.0, btw.

    Tim


  • Munna

    #2
    Re: Declarative Client Side javascript...

    On May 29, 8:03 am, "Tim Royal" <tim.ro...@sier raonline.comwro te:
    I know that programmaticall y, one can add attributes for controls that will
    be passed down to the client in html. Example:
    >
    servercontrol1. attributes.add( "onclick", "javascript:fly home()").
    >
    My question is, can this be done declaratively? I'd prefer not to have to
    add code to each of the controls I want to add client side javascript
    attributes for.
    >
    <servercontro l id="duh" onclick="javasc ript:flyhome()" >
    >
    Thanks. This is for ASP.NET 2.0, btw.
    >
    Tim
    HI

    asp.net button has a attribute onclientclick you can use that in case
    of asp.net button

    <asp:Button ID="btnSomethin g" OnClientClick=" window.alert('y ahoo');"
    runat="server"/>

    Thanks

    Munna


    Comment

    Working...