ASP.net 2.0 How to implement URL mapping tutorial

Source: Internet
Author: User
Tags config
asp.net| Tutorial |url Mapping

URL mapping is the new feature provided in ASP.net 2.0. URL mapping technology helps us map a particular URL to another URL. To help understand, let's say you have a page called Homepage.aspx on the site to access the homepage, and all users will use this page to access your homepage. But for some reason, you should change the homepage to originalhome.aspx. Using URL mapping allows you to map to a new page without having to notify the user.

If we set the URL mapping, then any user in the URL bar input homepage.aspx, the call is originalhome.aspx.

Deep concept:

Let's see how to implement it.

This can be implemented in the configuration section.

Grammar:

The following are the referenced contents:

Mappedurl= "String"/>

If you want to use URL mapping, you must set the Enabled property to True. Each add element contains an original URL and a mapping URL.

The elements in the config file appear as follows:

The following are the referenced contents:



Once we have modified or added elements as above in the Web.config file of the project, any user attempting to access Homepage.aspx will invoke the Originalhome.aspx page because of the URL mapping. Interestingly, the homepage.aspx is still displayed only in the URL bar. So despite the thought of internal call/execution originalhome.aspx, the user still sees hopepage.aspx in the URL bar.

Some advantages:

1. If your customer signs a link to a page, but you have to delete the page and change to another page, then use URL mapping you can solve this business problem without letting the customer know the page changes.

2. If there is a large and complex URL, but do not want to give it to the user, then you can tell the simple URL, and the simple URL itself to map to the original URL.

3. This method can be used to facilitate the processing of menu controls. The best example is the ASP.net site.

4. This also involves security (users cannot see the real page name in the URL bar, which is also an encryption!).

I hope you like this new feature.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.