views:

383

answers:

1

I'm sure I have seen this syntax

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

or something like it as a way to generate action URLs in ASP.net MVCs without magic strings. However, I can't find that Action overload. I have ASP.NET MVC 1.0. Where is it?

+6  A: 

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

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

<%= Html.BuildUrlFromExpression<MyController>(x => x.MyMethod(a)) %>
eu-ge-ne