Sunday, 17 May 2009

ASP.NET MVC v1.0 - Generic Html.ActionLink(...)

... was removed for release of version 1.0.

This has been documented in about a million other places, but not many posts reference where to get the 'ASP.NET MVC v1.0 Futures' DLL (as opposed to the BETA Futures).

It's here:


You need this DLL if you want to use the generic version of the ActionLink - which can be used like this:

==================================================================

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Bernard.Controllers"%>
<%@ Import Namespace="Microsoft.Web.Mvc"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>
    
    <ol>
        <li>
            <%= Html.ActionLink<MyController>(c => c.Index(), "MyStuff")%>
        </li>
    </ol>

</asp:Content>

==================================================================

As per the above example - remember to throw the additional 'import' statement in ...

No comments:

Post a Comment