ActionLink not redirecting to action

by Mikael Henriksson 16. February 2009 23:47

Tonight I had a problem with the Html.ActionLink. It would from one Controller not redirect to another one which was really pissing me off at the time. I tried using the RouteDebug from Phil Haack and it showed correct routing so I started to poke around in the Html helpers and found this great thing called RouteLink. Basically I can customize my links a bit better with this.

<%= Html.RouteLink("Throw", new 
		{ 
			controller = "Workday", 
			action = "DeleteWorkday", 
			Model.WorkdayID 
		})%>

With this helper I can make good use of any route I have mapped in global.asax. The reason I customize the routes is to be able to do these kinds of things. Not because I have to but because I can.

God I love the MVC framework. It’s like everything I’ve been missing with asp.net. No more configuring stupid not very configurable server controls!

Tags:

MVC

blog comments powered by Disqus

About the author

Life architect specialized in programming