2009-07-15 10 views
6

Ich bin sicher, dass ich diese SyntaxASP.net MVC Aktion URLs mit Lambda-Ausdruck

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

oder etwas als eine Möglichkeit Aktion URLs gesehen habe in ASP.net MVCs ohne Magie Saiten zu erzeugen. Allerdings kann ich die Überlastung der Aktion nicht finden. Ich habe ASP.NET MVC 1.0. Wo ist es?

Antwort

8

Sie benötigen ASP.NET MVC v1.0 Futures Montage:

<%= Html.ActionLink<MyController>(x => x.MyMethod(a), "text") %> 

<%= Html.BuildUrlFromExpression<MyController>(x => x.MyMethod(a)) %>