5 (100%) 1 vote

EasyHostingASP.NET | Best and cheap ASP.NET Hosting. Lets say you are working in a fairly large asp.net application. Now because of situation (or clients request) you want to change all the textbox or button control to some server control or user control. This can be very very tedious JOB if you are using Asp.net 1.X. But if you are using Asp.net 2.0 , there is a very easy way to get this done using tagMapping.

Best and Cheap ASP.NET Core 1.0 Hosting in India Click Here !

it’s a way to turn all instances of a type into another type at compile time. In human language it means that it can turn all e.g. System.Web.UI.WebControls.Textbox (in our example ) instances in the entire website into another control.That is so cool that I had to do a little example. I’ve created a very simple control that inherits from a TextBox and overrides the Text property so that it HTML encodes the text. I placed it in the App_Code folder and called it SafeTextBox.

Then I needed to hook the tag mapping up in the web.config to convert all the text boxes into SafeTextBox instances. It simply converts all TextBox instances on the entire site. Here is what’s needed in the web.config:

After we add the following line of code in the web.config file all the TextBox control will be mapped to the TextBox.

Alexia Pamelov

Alexia Pamelov

My name is Alexia Pamelov and I have spent the past 3 years building money making blogs review. Since then I have launched lots of successful nice blogs and after selling my survivalist blog I decided to teach other people how to do the same.
Alexia Pamelov