![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Guest | Intercept .asp requests and redirect to corresponding .aspx page I'm hoping someone here can help me. We have a rather large site that's undergoing a conversion from Classic ASP to .Net. It's pretty much been rewritten already. Let's say there was a /Travel.asp page, the new corresponding .Net page would be /Travel/Default.aspx We can easily create a config (xml) file with entries for each page and it's corresponding redirect page. But the question is, how do I intercept these requests and then redirect to the correct converted page? Someone in our department suggested that HttpHandler may be the answer, but in setting that up, we run into errors with the way the site is currently coded. It seems all functions and subs must be between <script></script> tags rather than <% %>. Otherwise, we get the following error: "Statement cannot appear within a method body. End of method assumed." There's no way this would be a feasible solution seeing as how large our site is, and to be honest, how poorly it was designed in the past. Think of the spaghetti model... So I think that option is out - unless someone has gotten this to work and I'm just doing something wrong. Basically I'm thinking any option that would require asp.net's dll to process our .asp pages would be a no-go because of this. So then I've read about ISAPI filters, and from my understanding, incoming requests to IIS are intercepted, but when it goes to the final page, the correct .dll will process the page still. No changes required to which .dll process which extension. Before I go digging in this direction, I was hoping for a little advice. One other final way would be just to call a function in one of our master includes (I'm sure hoping this include is in every page) and handling the logic in there. Thanks in advance, Chris T. |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Intercept .asp requests and redirect to corresponding .aspx page create a custom 404 .aspx page that will first look to see if the new page in question is in the map file, and do a permanent redirection, or show the generic 404... set this as the 404 handler in iis... not just for .net alternatively use the rewrite module with win2008 server, which will work a little nicer. On 11/16/2008 7:24 PM, Tifer wrote: Quote: > I'm hoping someone here can help me. We have a rather large site > that's undergoing a conversion from Classic ASP to .Net. It's pretty > much been rewritten already. Let's say there was a /Travel.asp page, > the new corresponding .Net page would be /Travel/Default.aspx > > We can easily create a config (xml) file with entries for each page > and it's corresponding redirect page. > > But the question is, how do I intercept these requests and then > redirect to the correct converted page? > > Someone in our department suggested that HttpHandler may be the > answer, but in setting that up, we run into errors with the way the > site is currently coded. It seems all functions and subs must be > between <script></script> tags rather than <% %>. Otherwise, we get > the following error: > > "Statement cannot appear within a method body. End of method assumed." > > There's no way this would be a feasible solution seeing as how large > our site is, and to be honest, how poorly it was designed in the past. > Think of the spaghetti model... > > So I think that option is out - unless someone has gotten this to work > and I'm just doing something wrong. > > Basically I'm thinking any option that would require asp.net's dll to > process our .asp pages would be a no-go because of this. > > So then I've read about ISAPI filters, and from my understanding, > incoming requests to IIS are intercepted, but when it goes to the > final page, the correct .dll will process the page still. No changes > required to which .dll process which extension. Before I go digging > in this direction, I was hoping for a little advice. > > One other final way would be just to call a function in one of our > master includes (I'm sure hoping this include is in every page) and > handling the logic in there. > > Thanks in advance, > > Chris T. -- Michael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.net icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email) .... FRA #010: Greed is eternal. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Using HttpWebRequest when the requested page does a Response.Redirect | .NET General | |||
| Multiple partial classes for an aspx page | .NET General | |||
| IE7 ProcID changes on Page-Redirect | Vista General | |||
| Exchange Powershell chrashes the IIS from an aspx page??? | PowerShell | |||