Default for ClientIDMode in ASP.NET 4
MSDN says:
The default
ClientIDMode
for the pagePredictable
. the defaultClientIDMode
for the control isInherit
. Since the default for controlsInherit
, the default generation modePredictable
. (However, if you are using Visual Studio to convert an ASP.NET 4 Web project from an earlier version, Visual Studio automatically sets the site to the defaultAutoID
in the fileWeb.config
.)
But it should also be mentioned that some old pages on MSDN still say the default ClientIDMode
for a page AutoID
(like here ), as pointed out in my previous answer.
a source to share
"The default ClientIDMode for the page is predictable.
"However, if you are using Visual Studio to convert an ASP.NET 4 web project from an earlier version, Visual Studio automatically sets the default AutoID for the site in the Web.config file."
http://msdn.microsoft.com/en-us/library/system.web.ui.clientidmode.aspx
If you set it on a control use the value of the control
else if you set it on the page use the page value
else if you entered it in your web.config use the value in your web.config
else use Predictable.
Any of them can and will break the code if the programmer has assumed that he is doing something different from what he is actually doing.
a source to share