I have seen a cool implementation of ASP.NET MVC Domain Routing.
Source: http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx
Could this be done on ASP.NET WebForms 4.0?
Does this mean ASP.NET Web Forms is dead and should no longer be used? Of course not! As long as the . NET Framework ships as part of Windows, ASP.NET Web Forms will be a supported framework.
There are a lot of existing Web Forms applications out there still being supported, maintained and developed further, and a lot of developers are still working with Web Forms. But web development is moving on. Frameworks need to be agile and lightweight.
Retrieving URLs within an ASP.NET Web Form The URL routing engine in ASP.NET can be used to both map incoming URLs to code handlers, as well as be used to programmatically generate outgoing URLs using the same mapping registration logic.
Asp.Net Web Form has built-in data controls and best for rapid development with powerful data access. Asp.Net MVC is lightweight, provide full control over markup and support many features that allow fast & agile development. Hence it is best for developing an interactive web application with the latest web standards.
Considering the fact that the Route class is not specific to MVC apps and can be easily used within the context of a plain ASP .NET WebForms project the DomainRoute class you linked to should work just fine in that context as well.
Should be an easy enough venture to prove out.
The answer to your question is yes. It's actually pretty simple. You could try the DomainRoute class or just write your own url rewriting module and be good to go. But basically you would use something like this:
http://www.gutgames.com/post/Url-Rewriting-in-ASPNet.aspx
And instead of the Path, you'd use the Url property and parse it however you want. Or you could just use an open source project like this:
http://sharedhostingsplittr.codeplex.com/
And modify it slightly if need be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With