473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Getting ASPX code to run when .asp is requested

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
Nov 19 '05 #1
3 1707
..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

"chuck rudolph" <ch**********@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
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

Nov 19 '05 #2
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
Nov 19 '05 #3
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
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nobody | last post by:
If I request: http://www.test.com/ which is implictly: http://www.test.com/index.aspx Request.Url contains the index.aspx portion regardless of whether or not the client requested the...
5
by: jonhyland | last post by:
Hey all, I'm writing a .NET application where I want all HTTP errors such as 404 to redirect back to the home page. Since .NET only handles HTTP errors if the client is requesting a .NET...
3
by: Schultz | last post by:
When using DropDownLists in ASP.NET VB 03 on Windows Server 2003 (IE 6) the selected values for Databound dropDowns is always the first item in the list, even after changing the selected item...
2
by: JIM.H. | last post by:
Hello, I know the user I give in the connection string is the database admin, why am I getting the following message? Server Error in '/' Application...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
5
by: Moskie | last post by:
I recently came across an application where the 'src' attribute of a script tag was an ASPX file. Like so: <script language="JavaScript" src="scriptfile.aspx"></script> This is a new idea for...
6
by: David Lozzi | last post by:
Hello there, I'm getting the following error System.NullReferenceException: Object reference not set to an instance of an object. at shopping_bag.GetBagTotals()
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.