Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET WebForms Domain Routing

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?

like image 369
naveen Avatar asked Apr 19 '11 11:04

naveen


People also ask

Is ASP.NET Web Forms dead?

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.

Does anyone still use Web Forms?

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.

What is used to retrieving URLs within a asp net web form?

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.

Which is better MVC or Web Forms?

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.


2 Answers

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.

like image 141
BGregorius Avatar answered Nov 11 '22 16:11

BGregorius


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.

like image 22
JaCraig Avatar answered Nov 11 '22 15:11

JaCraig