.NET Framework 2.0 SP1 – TagMapping Undocumented hotfix

While searching a way to solve the HtmlControls tag mapping problem I found that the new SP1 bring an extra undocumented hotfix.

This undocumented hotfix changes MainTagNameToTypeMapper.GetControlType method so that, for every tag name regardless is kind, a tag type mapping is always performed.

This little change enables us to tag map HtmlControls the same way we map WebControls and UserControls. read more

ASP.NET – Tag Mapping

Tag Mapping is not a new ASP.NET 2.0 feature, but only recently many people discover it.

<system.web>
<pages>
<tagMapping>
<add tagType=”System.Web.UI.WebControls.TextBox”
     mappedTagType=”MyTextBox”/>
tagMapping>
pages>

The use of Tag Mapping allow us to, at parsing time, replace a given control type with other control type. The only constrain is that new control type extends primary control type.

If I use Tag Mapping with Web Controls everything works fine but if, instead, I use Html Controls, like HtmlForm, with tag mapping no mapping is done.

Using Reflector I found no reason for this behavior.