Wednesday, April 14, 2010

ASP.NET 4.0 ClientID and ClientIDMode

In Web Forms development, when a web page is rendered from the server to the client, the client Ids are generated based on the placement of those controls. For example, a control placed in a user control within a page will have a different format from the control which is placed in a user control which in content place holder of a page inherited from the master page.

As long as we don't use client ids, we probably do not need to worry about what those names are like. But, .NET 4.0 provides a way we can use to have a controlled client ids generated. Those properties are available at a control level using properties for the control, at a page level using page directive on top of the page or at a web application in a web.config <pages> section.

  1. ClientID
  2. ClientIDMode ( "Static", "Predictable")

 

Technorati Tags: ,

No comments:

Post a Comment