CODEDIGEST
Skip Navigation LinksHome » Article » ASP.Net Article » URL Mapping in ASP.Net 2.0  Submit Articles and Win Geeky Prizes!!   You are not logged in.
Search
 

Product Spotlight
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
Read more..

Read more..

 
URL Mapping in ASP.Net 2.0

By Satheesh Babu
Posted On Jun 08,2008
Article Rating: (Login)
Be first to rate
this article.
No of Comments: 0
Category: ASP.Net
Print this article.

URL Mapping in ASP.Net 2.0

 

ASP.Net 2.0 provides a simple way to map a long URL to a short URL with the help of   <urlMappings> tag in Web.Config. With this feature URL rewritting becomes simple but with some big limitations.

For example,

 

  <urlMappings>

      <add url="~/Csharp.aspx"       

           mappedUrl="~/Articles/Csharp/Default.aspx"/>

      <add url="~/ASPNet.aspx"        

           mappedUrl="~/Articles/ASPNet/Default.aspx"/>

      <add url="~/Framework.aspx"        

           mappedUrl="~/Articles/Framework/Default.aspx"/>

    </urlMappings>

 

The above config settings routes the user to the URL given in mappedUrl property and thus makes the URL very simple and easily rememberable.

The drawback of this feature is when our websites grows drastically then maintaining this section in config file will be tedious.  To overcome this we can build a URL rewriting module using Regular expression.

The following article will help you in building this module.

URL Rewritting with regular expression.

 

Happy Coding!!!

Article Feedback
Title  
Submitted By  
Comment  
Enter the verification number
 
Comments