or so...">

ASP.net MVC Action Action URLs with lambda expression

I'm sure I saw this syntax

<%= Url.Action((MyController c) => c.MyMethod("a")) %> 

or something like this as a way to create action urls in MVC MVC without magic lines. However, I cannot find this overload. I have ASP.NET MVC 1.0. Where is it?

+6
lambda asp.net-mvc action asp.net-mvc-futures magic-string
source share
1 answer

You need the ASP.NET MVC v1.0 assembly :

 <%= Html.ActionLink<MyController>(x => x.MyMethod(a), "text") %> <%= Html.BuildUrlFromExpression<MyController>(x => x.MyMethod(a)) %> 
+8
source share

All Articles