Monday, January 4, 2016

ClientIDMode="Static" ...is not bulletproof!

This can fail! You may just get back a random client-side id. We are seeing it happen at an ASP.NET web site. Maybe it has to do with a Web.config configuration? A differing version of IIS or the .NET runtime? If you use a unique setting for CssClass (which translates to just class in the HTML made for the web forms control) and then latch onto that in jQuery with .whatever instead of #whatever as much is better.

 
 

Addendum 1/5/2016: ClientIDMode="Static" ...will just make it's way all the way up to the HTML in the UI when it fails as if it just isn't interpreted.

No comments:

Post a Comment