1

I need your advice regarding migration. I want to migrate existing project to ASP.NET MVC and I can figure out the proccess except of url rewriting issue:

for example how can I make following route:

http://www.eireads.com/ireland/mayo/cars-3/1263-used-cars-citroen-c5-for-sale.aspx

Or maybe I could somehow keep supporting legacy routes.

2 Answers 2

2

I think that migrating a web forms applicaiton to MVC is going to be very hard unless you have a clear seperation of concerns in your current applicaiton. If you have followed a design pattern like MVP then it might be easier, but if not then much of your business logic is likey going to have to be moved to controller classes and much of it re-written.

I would start by extracting your model, this should be fairly easy, then identifying your controllers and actions and seeing how much code you can re-use. At this point you should be able to discern whether or not you can migrate or if you'll be better off re-writing portions of your applicaiton.

Default URL patterns in ASP.NET MVC are http(s)://(appdomain)/(controller)/(action)/(par/ame/ters)

So your url above should fit into that pattern. You can change the pattern to account for other things (like namespace for example). Your URL pattern might be:

http://www.eireads.com/cars/used/ireland/mayo/citreon

where ireland, mayo and citreon are the in put parameters.

Sign up to request clarification or add additional context in comments.

Comments

0

I think you should really re-write your question and try to detail exactly what you are attempting to accomplish here.

If you are asking how to migrate an existing WebForm project into ASP.NET MVC keeping the same URL rewrite, the answer is; not easily. The models are too different.

Yet, you mention "routes" in the end, which make me think you are speaking like those of the System.Web.Routing namespace. So are you dealing with an existing MVC app and want it too look like that URL path? I can't tell. I am confused.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.