Pages

Showing posts with label url mapping. Show all posts
Showing posts with label url mapping. Show all posts

Saturday 20 June 2015

URL mapping in web.config

Introduction :
URL mapping is very useful tool to make your URL look good and meaningful to site user. It will overcome the querystring issue. The user sometimes got confused with the parameters passed in the url in the form of querystring.

Code :
For url mapping you have to pace this code in the web.config file in <system.web></system.web> tag

    <urlMappings enabled="true">
      <add url="~/ComputerCourse" mappedUrl="~/courses.aspx?cid=2"/>
      <add url="~/ComputerHardware" mappedUrl="~/courses.aspx?cid=3"/>
      <add url="~/MobileRepairing" mappedUrl="~/courses.aspx?cid=4"/>
      <add url="~/CuttingTailoring" mappedUrl="~/courses.aspx?cid=5"/>
      <add url="~/Beautician" mappedUrl="~/courses.aspx?cid=6"/>
    </urlMappings>