c# - ASP.Net FindControl is not working - How come? -
I have previously used FindControl , in the past. NET 2.0 / 3.0 seems like now, for some reason, the ID of my controls has been given an unusual name. For example I have specified a checkbox ID "cbSelect", but FindControl is not found when I see HTML, it was assigned ctl00_bodyPlaceHolder_ctl02_cb .
I have not found an example of FindControl that mentions it. Actually everyone just seems to be using normal-like controls.
So am I doing something wrong? Did Net change? Has anyone shed some light on this, it is really disappointing!
You probably have a masterpiece or user control (SECX) and that is why client ID has to be changed. Imagine that you have a control in a page with the same ID in the master page. This will conflict with ID change ensures that all client ID properties are unique on the page.
FindCentrol needs some special attention while working with MasterCages. FindControl works inside a Massage and Page are separate naming containers.
Comments
Post a Comment