3 ms·
In addition ASP.NET's naming container ID mangling which causes client IDs to be changed can be very counter productive for styling with CSS and for working wit
by mechanical_fish 18y ago
In addition ASP.NET's naming container ID mangling which causes client IDs to be changed can be very counter productive for styling with CSS and for working with elements using JavaScript. It's no fun referencing controls with references like $("#ctl000_StatusCtl_txtNameId") for element selection (with jQuery here) especially since those generated ID values can change.
Yeah, I sure can't understand why that system gets no respect. What a headscratcher!
- bdfh42 18y agoThe only place I have seen such ID "mangling" was when I had to do some work with an SAP portal - where the portal software was indeed doing some interesting things to HTML element Ids. I have built several active ASP.NET sites and I am building another now and I can say categorically that no such problem exists in the mainstream.
- johns 18y agoYou must not be working with JavaScript or Master Pages (or if you are, you're using Microsoft AJAX). Create a master page, then create a placeholder or panel in a content area, then put a textbox in it and refer to it by its generated HTML ID attribute (it's probably something like ctl00_MainContent_Panel1_MyTextBox at this point) in a javascript. Then if you move it to another panel, the ID changes. That's the mangling he's describing and it is by far the biggest issue I have with an otherwise solid framework.