0

Env: .NET 1.1

I got into this situation. Where I need to give a URL that someone could redirect them to our page. When they redirect they also need to tell us, what message I need to display on the page. Initially I thought of something like this.

So when we get this url based on 'reason' we can display different message.

But the problem turns out to be that they can not send any query parameters at all. They want 15 difference URL's since they can't send query params. It doesn't make any sense to me to created 15 pages just to display a message.

Any smart ideas,that have one URL and pass the 'reason' thru some means?

EDIT: Options I'm thinking based on Answers

Try HttpRequest.PathInfo

or Second option I was thinking was to have a httphanlder read

read the path like this - HttpContext.Request.Path

based on path act. Ofcourse I will have some 15 entries like this in web.config.

<add verb="*" path="reason1.ashx" type="WebApplication1.Class1, WebApplication1" /> <add verb="*" path="reason2.ashx" type="WebApplication1.Class1, WebApplication1" />

Does that look clean?

Broken Link
  • 2,396
  • 10
  • 30
  • 47

3 Answers3

2

Thoughts:

edit: both these approaches involve only one aspx page, but multiple urls pointing to it.

Stobor
  • 44,246
  • 6
  • 66
  • 69
  • Those are for later versions of .net. – Daniel A. White Jul 31 '09 at 00:09
  • @Daniel A White: why? http://urlrewriter.net/ does URL Rewriting for .NET 1.1... The link I pointed to explains it for various IIS and ASP.NET versions... – Stobor Jul 31 '09 at 00:14
  • Second option I was thinking was to have a httphanlder read read the path like this - HttpContext.Request.Path based on path act. Ofcourse I will have some 15 entries like this in web.config. Does that look clean? – Broken Link Jul 31 '09 at 00:16
  • @Broken Link: That looks very messy, having to update that in web.config all the time... But it would work, I'd guess... – Stobor Jul 31 '09 at 00:20
  • Read through all the options in the rewriting link; ScottGu is usually the guy with the answers when it comes to ASP.NET... – Stobor Jul 31 '09 at 00:21
1

Assuming IIS (I run this on IIS 6 but I expect it would run on 5 as well) you could install IIRF. You could then configure different "friendly" urls a la Apache's mod-rewrite and send them as query params to a single as*x page.

Cheeso
  • 189,189
  • 101
  • 473
  • 713
cori
  • 8,666
  • 7
  • 45
  • 81
0

Can they send POST variables?

Too bad you are at 1.1 because the later versions support routing which allows for RESTful URLs.

Another option would to be write a custom HttpModule and intercept the incoming requests.

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445