IIS letting ASP.NET do the work


B

Brandon Potter

I'm having a bit of trouble figuring out how to let IIS 6 pass on default
document requests for documents that don't exist to ASP.NET.

In a simplified version of my application, all of the "pages" are user
controls (.ascx files), and I have one "master page" (no, this is not 2.0)
that contains the template for the site. I have written an HttpHandler that
takes the URL, which would be www.mysite.com/test.aspx, and process it
through template.aspx, load "test.asCx" into the content of the template,
etc. This works beautifully, except when IIS has to put some forethought
into serving up the page.

When I request www.mysite.com/somedirectory/, IIS looks at the default
documents and I get the 'directory listing forbidden' error, because there's
no default.aspx in the folder (there is only a default.ascx).

This would work with my HttpHandler if I could get IIS to pass these types
of requests on to it. Is there a way of doing this without A) putting a
dummy default.aspx in every folder, and B) not letting IIS serve .ASCX files
directly in the event someone requested a .ascx URL?

Thanks,
Brandon
 
Ad

Advertisements

C

Cowboy \(Gregory A. Beamer\)

Go to the old vbpj site and do a searh for "hierarchical URL". There is a
great article on making friendly URLs and redirecting to other pages. While
not particularly your issue, it shows you how to use a HttpHandler to
redirect non-existent requests.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top