User Controls and javascript
I have wondered about this for a long time, but have also long since accepted the circumstances.
Why, when I place form elements on a user control, does it have to append "UserControlId_" to the id
of the element and "UserControlId:" to the name of the element? This is really annoying for custom javascript that is written for these elements and form submissions. Once you realize that
this happens, its not that difficult to define a javascript variable and append it to the beginning of all the elements that
you are using, or parse the form collection on the codebehind before you use the posted data, but it can still be frustrating. I was hoping that this behavior would be removed when master pages came out
with asp.net 2.0, but alas, after working on a side project using master pages, I see that this still occurs.
Does anyone know why this is neccesary?