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"          mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0"/>


</tagMapping>

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*