Mapped .NET type to Different type using web.config tagMapping element

יום ראשון, נובמבר 2, 2008

Hi All, You can mapped any .NET types that found on one assembly to other type that found on second assembly using the tagMapping element on the web.config. On the example below I show how can you mapped the .NET validators types, found on System.Web.dll to your own custom assembly named "Validators.dll". <tagMapping>     <add tagType="System.Web.UI.WebControls.CompareValidator"          mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0"/>     <add tagType="System.Web.UI.WebControls.CustomValidator"            mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0"/>     <add tagType="System.Web.UI.WebControls.RangeValidator"            mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0"/>     <add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0"/>     <add tagType="System.Web.UI.WebControls.RequiredFieldValidator"    mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0"/>     <add tagType="System.Web.UI.WebControls.ValidationSummary"       ...