DevWebProFrance News Archives About Us Feedback

Web News

France Telecom confirms has signed iPhone...
France Telecom chief executive Didier Lombard confirmed the group has signed a contract with Apple Inc making its Orange unit the distributor of the iPhone in France...

Philips France finds app management cuts need...
Philips France, the division of the global electronics company, thought it might need to buy more DSL lines to serve 600 workers at a branch office in Le Mans, but found an application acceleration appliance that worked...

France considers change in broadcasting rules
The French Culture Ministry said Tuesday that it was considering a change in broadcasting rules to facilitate the emergence of bigger domestic media groups that...

Hermes files court case against eBay
French luxury group Hermes International has launched legal action against online auctioneer eBay over the sale of counterfeit goods on its pages, weekly Challenges Magazine reported on Wednesday. The magazine...


10.11.07


ASP.NET - Tag Mapping

By Mads Kristensen

Recently I started working at ZYB and haven't seen all the code yet.

Then the other day I fell over a special section in our web.config called tagMapping. I've never heard about it before so I asked around and did a little detective work. Basically, 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 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.



Cost Effective Website and Network Monitoring
IPCheck Server Monitor - Free Download

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:



That is one smart way of applying your own server control substitute classes on a site wide basis. I'm still a little frustrated by the fact that I didn't know about this before very recently.

Comments

About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

About DevWebProFrance
DevWebProFrance is for professional developers ... those who build and manage applications and sophisticated websites. DevWebProFrance delivers via news and expert advice New Strategies In Development.

DevWebProFrance is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com NetworkNewz.com


-- DevWebProFrance is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
 © 2007 iEntry Inc.  All Rights Reserved  Privacy Policy Legal  
 

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


New Strategies In Development
DevWebProFrance Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact