Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Defining Attributes.Add() in the Script side?
Message
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01297763
Message ID:
01297781
Views:
27
>Is it possible to "move" the following code from code behind:
>
>
>Help.Attributes.Add("onclick", "javascript:window.open('help.htm'); return false;");
>
>
>to the design/script side of the page:
>
>
><asp:Button id="Help" runat=server Text="Help" />
>
>
>That is, I would like to be able to include the .Attributes.Add(...) right in the
<asp:Button ...>
code.
>
>Thank you.

Yes with ASP.NET 2.0 you can use onClientClick.
<asp:Button id="Help" runat=server Text="Help" onClientClick="window.open('help.htm'); return false;)" />
Michael McLain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform