Getting ASPX code to run when .asp is requested

G

Guest

Folks, I know this sounds odd, but I have a client that has some middleware
that is making a http post to "pagename.asp". I sure to don't want to have to
write asp code, so is there some way to get IIS (w2k3 server) to shuttle this
request over to an aspx page?

I have tried the following and gotten these results:

1. Wirte an asp page that does a redirect. Works fine except the posting
program balks at the redirect.
2. In pagename.asp, attempt a server.tranfer("pagename.aspx") - not
suprisingly this throws an error. I did not try server.execute
3. Change IIS config the use the aspx dll hander for the asp page. I
expected this one to work, but it gives me a "type of page not servered"
error.

And ideas are appreciated. Thanks in advance...Chuck
 
R

Rick Strahl [MVP]

..asp and .aspx are just script maps, so it's easy to assign the .asp
scriptmap to the ASP.NET ISAPI handler in IIS.

However, in most cases this probably won't work as the code in the ASP page
probably won't run as is in ASP.NET. So what you probably want is to route
to ASP.NET but use an HTTP handler to re-route the URL to another ASPX page
(of the same name maybe?) and handle it from there.

You can find lots of examples of this sort of UrlRewriting scheme if you
search Google...

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
 
G

Guest

Rick, I see how to rewrite from asp to asp and from aspx to aspx, what I
don't see is from asp to aspx. Should I be able to do this? I'm asking
becuase the server has already started to interpret the page when it figures
out it needs to switch internal environments from asp to aspx.

Thanks...Chuck
 
G

Guest

Actually, you don't need an url rewrite at all. You need to do the following:

1. Remap *.asp to the aspx page handler in the IIS website that you want to
modify.

2. Change the *.asp httphandler (in machine.config) to run the
PageHandlerFactory instead of Forebidden. (The config setting advertises
that it supports paths, but I did not test this.)

And you are done. Further if you need more control, the item to google for
is ISAPI filter, not urlrewrite.

....Chuck
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top