views:

163

answers:

4

Is there a built in method to handle urls like Default.aspx/mycontent or do I need to handle it myself by taking the url and stripping of the file's path?

I have tried searching for it but haven't been able to find anything.

I'd like to handle .aspx/parameters and am not looking at Mod/URL Rewrite.

A: 

Take a look at ASP.NET MVC. This framework obviously goes far beyond just "user-friendly" URLs, but it does also handle this as a byproduct.

Or you could just write a HttpFilter...

AviD
I have read about Asp.Net MVC but its difficult changing my development model altogether and switch to Asp.net MVC.
Abhishek
Understandable, whereas an HttpFilter makes it much easier, and can be completely transparent (though not completely trivial).
AviD
A: 

If you want you're app to do "friendly urls" then surely you would want to avoid ".aspx" appearing in the URL? Have considered ASP.NET-MVC or at least the routing elements of it.

AnthonyWJones
+1  A: 

You could either write an url rewrite handler, use ASP.NET MVC routing in your webforms application, or use ASP.NET MVC instead of webforms.

Darin Dimitrov
A: 

You can parse out the appended "folder" using the Request.Url.Segments Array:

this.Response.Write(this.Request.Url.Segments[this.Request.Url.Segments.Length - 1]);

Then use Server.Transfer or render whatever you like. You will often have problems with relative paths and such for CSS and the like.

Ishmael