tags:

views:

161

answers:

3

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?

A: 

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
No, they can't send post variables.
Broken Link
We have few limitations with some third party products. We can't migrate to next versions.
Broken Link
+2  A: 

Thoughts:

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

Stobor
Those are for later versions of .net.
Daniel A. White
Atleast the rewriting part.
Daniel A. White
@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
I guess the PathInfo is kind of really cool. Let me try.
Broken Link
Second option I was thinking was to have a httphanlder read read the path like this - HttpContext.Request.Pathbased 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
@Broken Link: That looks very messy, having to update that in web.config all the time... But it would work, I'd guess...
Stobor
Read through all the options in the rewriting link; ScottGu is usually the guy with the answers when it comes to ASP.NET...
Stobor
I think pathinfo kind of works for me thanks to you.
Broken Link
+1  A: 

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.

cori