Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining Attributes.Add() in the Script side?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01297763
Message ID:
01297810
Vues:
26
>>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;)" />
>
I do use ASP.NET 2.0. But when I copies and pasted your code into my page, it does not work. What happens is the page seem to be posted back to the server but htm file help.htm is not opening.

Thank you for your suggestion.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform