public Blog<BenR>

Ben Reichelt's Blog

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Blogs

Subscriptions

Post Categories



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?

posted on Tuesday, December 21, 2004 11:32 AM by reic0113





Powered by Dot Net Junkies, by Telligent Systems