thoughts on programming and computer related stuff RSS 2.0
# Friday, June 05, 2009
I have recently been working on a project where we reimplement an old web application with a new one. Since there has been an page on the same address before, there are also some old applications in other places linking to pages on the old site. For instance, the login.aspx file is linked to in a lot of places.

I will in my example use a link to the page login.aspx in my solution.

To get these links to work, I had (as far as I'm aware of) two options. To make a login.aspx and redirect in this file and add login.aspx to global.asax IgnoreRoute, or to map a new route in global.asax and redirect to my new login. The latter is the solution i went for.

To accomplish this all I had to do was to add the following to RegisterRoutes method in global asax:

routes.MapRoute("Handle login", "login.aspx", new { controller = "Login", action = "Index", id = "" });


Very easy, and now, every request for http://myapp/login.aspx is handled by http://myapp/login/index/

Friday, June 05, 2009 4:43:20 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
.NET | ASP.NET | ASP.NET MVC
Comments are closed.
Navigation
Archive
<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Gaute Magnussen
Sign In
Statistics
Total Posts: 17
This Year: 0
This Month: 0
This Week: 0
Comments: 1
Themes
Pick a theme:
All Content © 2010, Gaute Magnussen
DasBlog theme 'Business' created by Christoph De Baene (delarou)