url mappings in asp.net

I found this one very interesting in asp.net. If you want to give an alias to your urls that contains weired query params, it can be achieved easily using web.config file in asp.net. You need to add <urlMappings enabled="true"> tag inside the <system.web> tag and then you have to add one more tag (<add url="your alias url" mappedUrl="your url with query params") inside urlMappings tag. That's it. :) I have given one example below:

<system.web>

<urlMappings enabled="true">

<add url="~/content/general/university_calendar.aspx" mappedUrl="~/content/general/frontmatter.aspx?fmcode=UNCL&fmname=UGRAD"/>

</urlMappings>

</system.web>

Comments

Popular posts from this blog

html to Word Document Converter using Open XML SDK

How to: Get Top n Rows of DataView in C# asp.net

Argument Essay Writing- Agree or Disagree