2. March 2010 12:27
Recently, I was troubleshooting a difficult to find bug in an ASP.NET website. The bug was clearly environmental since the website worked for many other customers. We could only reproduce it on this particular customer’s server, so my diagnostic options were limited.
This application contains an ASP.NET DataGrid control that will redirect to a new page when a row is clicked. After some SQL and ASP.NET tracing, I determined that the server-side RowCommand event wasn’t firing.
This works normally, however on this customer’s server clt01 was being named _ctl01, this broke the original developers assumption about names since the first underscore was actually part of the control name and not a delimiter. When the post back made it to the server, ASP.NET didn’t fire the server-side event because the names were wrong.
The correct way to fix this would be to use the ClientScriptManager (via Page.ClientScript) to emit the correct __doPostPostBack(…) statement, but this particular application relies heavily on ASP.NET’s “normal” naming convention. The quick and simple solution was to add the <xhtmlConformance mode=”Transitional” /> element to the web.config. Since Transitional is the default mode for this setting, I assume (but didn’t verify) that the mode was set somewhere deeper in the configuration stack such as a root-level web.config or machine.config.
Details for this setting are here –> http://msdn.microsoft.com/en-us/library/ms228268.aspx