URL Mapping in asp.net 2.0

January 18, 2008

URL Mapping is a mechanism by which you can change the displayed url in address bar.

Example:

Your asp.net application is developed from years, with convention frm as prefix to webform.

Now to change already assigned name to legacy system which is maintained for past few years and to avoid risk we can make use of URL Mapping.

For URL Mapping
Step1: Add Mapping URL in web.config file.
<system.web>
<
urlMappings enabled=true>

<add url=~/Department.aspx mappedUrl= oldforms/frmDept.aspx/>

<add url=~/Employee.aspx mappedUrl= oldforms/frmEmployee.aspx/>

<add url=~/Product.aspx mappedUrl= oldforms/frmProduct.aspx/>

</urlMappings>

</system.web>


Step2: Change the URL in .aspx file

<a href=”Department.aspx”>Department</a><br />

<a href=”Product.aspx”>Product</a><br />

<a href=”Employee.aspx”>Employee</a>


Step3: Now Check your ugly looking URL, it is replaced with New desired URL.

Before URL Mapping


After URL Mapping


Entry Filed under: .Net. Tags: .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Categories

Category Cloud

.Net Business HTML & CSS & DOM Javascript PHP Tool

Tags

.Net ADO.NET ajax Business Javascript Oracle ADO.NET Subversion .Net Subversion SVN Source VB.Net

Recent Posts

Archives

Blogroll

Recent Comments

Asaduzzaman Arif on Encrypt/Decrypt string VB…
Pranav on Encrypt/Decrypt string VB…
ntcnet on Encrypt/Decrypt string VB…
Elena on Encrypt/Decrypt string VB…
Elena on Encrypt/Decrypt string VB…

Twitter