Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why this code is not executing?
Message
 
 
À
29/10/2012 11:34:31
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01555962
Message ID:
01555965
Vues:
37
>Your edit view is probably looking for a single client. You are passing it clients which would probably be of type IQueryable or IEnumerable. Try using clients.First().

Sorry, I still see nothing :(

This is the Edit view:
@model CardNumbers.Objects.Client

@{
    ViewBag.Title = "Edit";
}

<h2>Edit Client @Model.Id</h2>

@using (Html.BeginForm()) {
   
        @{Html.RenderPartial("_ClientForm", Model)   ;}        
 
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>


}
and this is the _ClientForm.cshtml:
@using WebDemo.Helper
@model CardNumbers.Objects.Client
<fieldset>
    <legend>Client Info</legend>

    @Html.ValidationSummary(true)

    <input type="hidden" id="fntype" name="fntype">
    @Html.HiddenFor(model => model.Id)
    @Html.EditorFor(model => model.Number, EditorTemplate.TextBox)

    @Html.EditorFor(model => model.Name, EditorTemplate.TextBox)

    @Html.EditorFor(model => model.Address, EditorTemplate.EditBox)
    
    <div id="ContactsInfo">
        @*Contact 1*@
        
        <div id="Contact1">
            
         @Html.EditorFor(model=>model.Contact1)
         
        </div>

        @*Contact2*@
        <div id="Contact2">
            
           @Html.EditorFor(model => model.Contact2)
        </div>
    </div>
    @*<div class="clear"></div>*@
    <div id="SaveCancel" class="float-right">
        <button type="Submit" id="btnSave">Save</button>
        <button type="reset" id="btnCancel">Cancel</button>
    </div>
</fieldset>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform