Chris,
What you want to do ( process a custom file extension ) is
poorly documented in the ASP.NET 2.0 beta documentation,
but fairly easy to do.
Here's what you need to do :
Open the Internet Services Manager.
If your folder isn't configured as an Application,
configure it as an Application before proceeding.
1. Right-click the virtual folder that contains
your ASP.NET application, and then click Properties.
2. Click the Configuration button.
3. Highlight and Click the .aspx application mapping, and then click Edit.
4. Select the text in the Executable text box,
and then press CTRL+C to copy the text to your clipboard.
Click Cancel to return to the Application Configuration dialog box.
5. Click the "Add" button, paste the clipboard text into the "Executable" textbox,
and write in the file extension you want ( chris, for example - don't include the dot)
6. In the Verbs section, click to select Limit To, and then copy and paste "GET, HEAD, POST, DEBUG"
( without the quotes ) in the text box.
Click OK 3 times to get out of the Application Properties.
Now, here's a sample web.config to enable the .chris extension :
web.config :
------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<httpHandlers>
<add verb="GET, HEAD, POST, DEBUG" path="*.chris" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
<compilation>
<buildProviders>
<add extension=".chris" appliesTo="Web" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
</system.web>
</configuration>
-----------------
That's it!
You can now access pages with the .chris extension,
and they will be processed just like .aspx pages are processed.
Easy, isn't it ?
Let us know how you do.
Juan T. Llibre
ASP.NET MVP
===========
"Christopher Baldwin" <cb******@gmail.com> wrote in message news:11*********************@z14g2000cwz.googlegro ups.com...
Hello,
Using ASP.NET v2.0.40607.42, I'm attempting to create a new file
extension that should be handled exactly like "aspx" pages. For
example, I just want to rename an aspx page from "test.aspx" to
"test.extx", where .extx extensions are handled in exactly the same way
as aspx pages.
In pre-2.0 versions of ASP.NET, simply adding a HttpHandler element
(below) to web.config, and adding a IIS mapping of "extx" to
aspnet_isapi.dll was sufficient:
<httpHandlers>
<add verb="*" path="*.extx" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
Now, in 2.0 I get this error:
There is no build provider registered for the extension '.extx'. You
can register one in the <compilation><buildProviders> section in
machine.config or web.config. Make sure the appliesTo attribute
includes the value 'Web' or 'All'.
I cannot find any good reference about build providers. I don't think
I should have to write a custom build provider because I want the page
to use whatever standard aspx pages use. What is the default build
provider class used for aspx pages?
Any advice will be greatly appreciated!
Best,
chris
4
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.794 / Virus Database: 538 - Release Date: 11/11/2004