My iis7.5 does not support ASP. NET routing.

Source: Internet
Author: User

In the MVC mode, the URLs that are friendly and block specific physical files are visible to me. I also want to use them in the web form project.

Follow the instructions to add global. asax and write the routeCodeOr something:

 
<% @ Application language = "C #" %> <% @ import namespace = "system. web. routing "%> <SCRIPT runat =" server "> void application_start (Object sender, eventargs e) {// In the applicationProgramCode that runs at startup: registerroutes (routetable. routes);} public static void registerroutes (routecollection routes) {routes. mappageroute ("","","~ /Default. aspx "); routes. mappageroute (" test "," H/{product }","~ /Temp/test. aspx ");}

When you run the command in IIS, page not found is returned!

Then run the command in vs2012, but the route is incorrectly written.

According to Daniel, in versions earlier than iis7, you must specify the suffix name and Add. aspx. For example, this method should be used.

Routes. mappageroute ("test", "H. aspx/{product }","~ /Temp/test. aspx ");

What is the significance of this route? But I tried it. But this is boring.

This indicates that in iis7.5, if. aspx is not specified, it is not processed by ASP. NET at all, and routing does not work.

This is strange, my IIS is iis7.5 under win7, the application pool mode is integration, Asp. net4.0, everything is in line with the legendary "you can directly use ASP without any configuration.. net routing.

Is it because I installed Microsoft's URL rewriting module? Uninstall and restart. No.

You cannot register ASP. net4.0 again.

Who will tell me?

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.