views:

41

answers:

4

Hi,

I'm trying to implement a "restful" application using ASP .NET 3.5 but it seems that I need to use MVC .NET. Is that the only solution?

For instance, I would like something like:

/api/nab/(version)/(slug)

I'll be happy to know how you manage to do that.

+2  A: 

You could use the routing engine from ASP.NET MVC (actually, it's from .NET 3.5 SP1) and use it with your old WebForms.

Check out this article: Using Routing With WebForms

Developer Art
thank you very much! ASP.NET MVC sounds really interesting
lgu
A: 

One answer, ASP.NET MVC. It's going to be your easiest solution and it's a great API to learn.

PieterG
A: 

Phil Haack blogged on this a while ago, I looked it up: Using Routing With WebForms

Basically you use the routing API with a webforms handler. Routing takes an url, parses it into parameters and passes that to an implementation of the IRouteHandler interface. This is a pretty simple interface (see this blog for details on how to create your own), which basically gets the parameters from the route handler and creates a HttpHandler for you.

Erik van Brakel
A: 

There are http modules and etc out there to perform url re-writing, but as mentioned in the other answers, your best bet is to use the routing component of ASP.NET MVC without actually using the MVC bit.

However, if you're steadfastly against that, then there are libraries out there to help you:

Here is a good round-up of those methods Url Rewriting with ASP.NET

Rob Ashton