Overview of .NET 4.0 features – ASP.NET 4.0 ClientIDMode(dotnetcube.com)
submitted by
dncdude(1350) 2 years, 8 months ago
In pre 4.0 days, when a server control is rendered, the framework would assign an ID to the control based on the control hierarchy. For example, a textbox of id "txtTest" in a user control that is used on a page would be rendered with the ID "WebUserControl11_txtTest". Developers could use the ClientID property (ex: txtTest.ClientID) in the code behind to retrieve the ID assigned to the control by the framework. It was essential for the framework to assign the IDs this way to maintain uniqueness of the IDs on a page. In the prior example, the User Control that inherits from the System.Web.UI.UserControl implements the INamingContainer interface. Any control (either custom or a .NET control) that implements this interface would ensure unique naming scope for the child controls.
|category: ASP.NET
|Views: 611
tags:
ASP.NET another
Everyones tags:
Your Tags: