Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass ClientID in OnClientClick
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01301882
Message ID:
01301897
Vues:
16
>>Hi everybody,
>>
>>Here is what I have in ASPX file:
>>
>><asp:Button ID="btnCancelProfile" runat="server" Text="Cancel" CausesValidation="False"
>>                                                    EnableViewState="False" OnClientClick="HideElement('< %# tblProInfo.ClientID % >');"
>>                                                    UseSubmitBehavior="False" />
>>
>>
>>Something is wrong here, because in the script I get What as
< %...
instead of the actual id.
>>
>>What should I change to make it work?
>>
>>Thanks a lot in advance.
>
>The < %# syntax in ASP.NET pages is for data binding. Use < %= instead. Get rid of the extra spacing.
>
>I posted something about this on my blog:
>
>http://www.rcs-solutions.com/blog/2007/10/19/AccessingASPNETGeneratedControlsFromJavascript.aspx

I tried both syntaxes already and it simply didn't work. I don't have extra spaces, it's UT parser that inserts them.

E.g.

I now have
EnableViewState="False" OnClientClick="HideElement('<%= tblProInfo.ClientID %>');"
but it is still not working.

I'm using AJAX if it has anything to do with this.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform