Cannot resolve action

How does Resharper attempt to resolve the action in an Html.ActionLink?  I'm getting a couple of errors regarding valid actions that exist. See attached file CannotResolveAction.zip for screenshots and code for one such example.

When the controller name is not specificed I'm not sure how it resolves it.  I do have a custom directory structure that differs a bit from the 'stock' configuration; it uses this technique: http://www.clanmonroe.com/Blog/archive/2009/04/30/organize-your-views-in-asp.net-mvc.aspx


<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<TWMaintenance.ViewModels.Physician.PhysicianContractViewModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
     Physician: Confirm Contract Company Changes
</asp:Content>
<asp:Content ID="confirmContractChangesScriptContent" ContentPlaceHolderID="ScriptContent" runat="server">
    <link href="<%= Url.Content("~/Content/dot-luv/jquery-ui-1.7.2.custom.css")%>" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function ShowWaitCursor() {
            $('body').css('cursor', 'wait');
            $('#changeContractButton').attr('disabled', 'disabled');
            if ($('#updateResults').hasClass('ui-widget-content'))
                $('#updateResults').removeClass('ui-widget-content');
        };
        function RevertCursor() {
            $('body').css('cursor', 'default');
            $('#changeContractButton').removeAttr('disabled');
        };    
        function HandleError(ajaxContent) {
            var response = ajaxContent.get_response();
            var statusCode = response.get_statusCode();
            $('#updateResults').html('Error: ' + ajaxContent.get_data() + '\r\n\r\nStatus code: ' + statusCode);
            //alert('Error: ' + ajaxContent.get_data() + '\r\n\r\nStatus code: ' + statusCode);
        }
    </script>
</asp:Content>

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

    <h2>Confirm Change Contract Company</h2>

    <% if (Model.Count() > 0)
       {
           using (Ajax.BeginForm("ChangeContract", "ChangeContractCompany", new { routeValue = Model }, new AjaxOptions { UpdateTargetId = "updateResults", LoadingElementId = "ajaxLoader", OnFailure = "HandleError", OnBegin = "ShowWaitCursor", OnComplete = "RevertCursor" }, new { id = "changeContractForm" }))
           {               
            %>       
    <table>
        <tr>
            <th>
                Physician Id
            </th>
            <th>
                First Name
            </th>
            <th>
                Last Name
            </th>
            <th>Contract Id</th>
            <th>Company Id</th>
            <th>Company Name</th>
        </tr>

    <%
        int idx = 0;               
        foreach (var item in Model)           
       { %>
    
        <tr>
            <td>
                <%= Html.Encode(item.PhysicianId)%>
            </td>
            <td>
                <%= Html.Encode(item.PhysicianFirstName)%>
            </td>
            <td>
                <%= Html.Encode(item.PhysicianLastName)%>
            </td>
            <td><%= Html.Hidden(Html.BuildSetIndexName("contracts", idx, "ContractId"), Html.Encode(item.ContractId)) %>
            <%= Html.Encode(item.ContractId)%></td>
            <td><%= Html.Encode(item.CompanyId)%></td>
            <td><%= Html.DropDownList(Html.BuildSetIndexName("contracts", idx, "CompanyId"), new SelectList(ViewData["companies"] as IEnumerable<TWMaintenance.ViewModels.CompanyViewModel>, "CompanyId", "CompanyName", item.CompanyId))%> </td>
        </tr>
    
    <%
        idx++;                   
       } %>

    </table>
    <br />
    <input type="submit" value="Change" id="changeContractButton" name="changeContractButton" />
    <% } // end Ajax.BeginForm %>
    <div id="ajaxLoader" ><img src="<%= Url.Content("~/Content/loading-recycling.gif") %>" alt="AJAX loader" /></div>
    <div id="updateResults"></div>
    <% }
       else
       { %>
       <div ><h3 >No Data Found!</h3><p>No contracts were found for the selected providers.</p></div>
    <% } %>    
    <p>
        <%= Html.ActionLink("Search Again", "StartChangeContractCompanyProcess")%>
    </p>

</asp:Content>



Attachment(s):
CannotResolveAction.zip

Please sign in to leave a comment.