How to map file extensions to Asp.net

Source: Internet
Author: User

An advanced (but not difficult) option supported by Asp.net is to map custom file extensions to Asp.net resources. for example, for an Asp.net page, no extension is required. aspx uses the extension. renyu, to ensure that Asp.net supports default. renyu must be modified as follows:

First, you must create the following new entries in the

<Configuration>

<System. Web>

<Httphandlers>

<Add verb = "*" Path = "*. renyu" type = "system. Web. UI. pagehandlerfactory, system. Web"/>

<Httphandlers>

</System. Web>

<Configuration>

Second, you must notify IIS to send the request to Asp.net. With the extension. renyu, which is completed through the IIS Microsoft Management Console.

Open iis mmc, right-click the web root directory or Web ApplicationProgramFolder (if you only want to map to an application), then select Properties option. Open the dialog box, click the configuration button, and select the app Mappings tab.

This tab provides all extensions mapped to the ISAPI extension by IIS. ISAPI is a low-level API that allows you to insert custom applications into IIS. in the past, ASP used the name ASP. dll ISAPI, now ASP.. net uses the ISAPI named aspnet_isapi.dll. ASP. net ISAPI is only responsible for receiving requests from IIS and passing them to Asp.net. if you want Asp.net to process. renyu extension, you need to map it to aspnet_isapi.dll, so that IIS can send the request to ASP. net.

To add the application, click Add to open the Add/edit application extension mapping dialog box. then give the directory c: \ [winnt] Microsoft. the name of Asp.net ISAPI (aspnet_isapi.dll) in net \ framework \ [version. you can also give the extension. renyu name.

Attached Asp.netArticle: Http://forums.asp.net/938703/ShowPost.aspx

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.