Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The type arguments for method 'System.Web.Mvc.Html.InputExtensions.TextBoxFor<tmodel,tproperty>(System.Web.Mvc.HtmlHelper<tmodel>, System.Linq.Expressions.Expression<system.func><tmodel,tproperty>>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.


XML
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/OnlineMenu.Master" Inherits="System.Web.Mvc.ViewPage<PizzaStore.Domain.Entities.Customer>" %>

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

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

 <h2 align=center>Customer Signup</h2>

    <% using (Html.BeginForm("Edit", "Customer")) {%>
        <%: Html.ValidationSummary(true) %>

            <table align=center>
                <tr><td>Title:</td><td>
                    <div class="editor-field">

                    <%: Html.TextBoxFor(model => model.Title )%>
                    <%: Html.ValidationMessageFor(model => model.Title) %>
                    <%: Html.HiddenFor(model => model.CustomerId) %>
                    </div>
                </td></tr>
                <tr><td>First Name:</td><td>
                    <div class="editor-field">
                    <%: Html.TextBoxFor(model=> model.Firstname) %>

                   <%: Html.ValidationMessageFor(model => model.FIrstname) %>
                    </div>
                </td></tr>
                <tr><td>Surname:</td><td>
                    <div class="editor-field">
                    <%: Html.TextBoxFor(model => model.Surname) %>
                    <%: Html.ValidationMessageFor(model => model.Surname) %>
                    </div>
                </td></tr>
           <tr><td>Contact Phone:</td><td>
                    <div class="editor-field">
                    <%: Html.ValidationMessageFor(model => model.ContactPhone) %>
                    <%: Html.TextBoxFor(model => model.ContactPhone) %>
                    </div>
                </td></tr>
                <tr><td>Email:</td><td>
                    <div class="editor-field">
                     <%: Html.TextBoxFor(model => model.Email) %>
                    <%: Html.ValidationMessageFor(model => model.Email) %>
                    </div>
                </td></tr>
                <tr><td>Password:</td><td>
                    <div class="editor-field">
                    <%: Html.TextBoxFor(model => model.LoginPassword) %>
                    <%: Html.ValidationMessageFor(model => model.LoginPassword) %>
                    </div>
                </td></tr>
             
               
          
            </p>

    <% } %>

</asp:Content>
Posted
Updated 31-Oct-14 23:03pm
v3

1 solution

Without code and scenarios, it is difficult to say. See Problems using TextBoxFor with viewModels in MVC[^] to get some idea.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900