Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EF attributes that can only be changed from code
Message
De
04/04/2013 11:04:27
 
 
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:
01569983
Message ID:
01570072
Vues:
30
This message has been marked as a message which has helped to the initial question of the thread.
That could be the problem. If they aren't in the view, the old values won't be saved. You can put them in @Html.Hidden fields in the view (make sure they're part of the form... ie, between the form tags).


>Right now they are not in the view at all. This is my main view which is partial view called _ClientForm.cshtml
>
>
>@using CardNumbers.Helper
>@model CardNumbers.Models.ClientViewModel
>  <form id="add-edit-form">
>    <fieldset>
>        <legend>Client Info</legend>
>
>        @Html.ValidationSummary(true)
>       
>        <input type="hidden" id="fntype" name="fntype" value="Edit">
>
>        @Html.HiddenFor(m => m.ClientId)
>        @Html.EditorFor(m => m.ClientNumber, EditorTemplate.TextBox)
>
>        @Html.EditorFor(m => m.ClientName, EditorTemplate.TextBox)
>
>        @Html.EditorFor(m => m.Client.Address, EditorTemplate.EditBox)
>
>        <div id="ContactsInfo">
>
>            <div id="Contact1">
>
>                @Html.EditorFor(m => m.Client.Contact1)
>
>            </div>
>
>            <div id="Contact2">
>
>                @Html.EditorFor(m => m.Client.Contact2)
>            </div>
>        </div>
>
>       @* <div id="SaveCancel" class="float-right">
>            <button id="btnSave">Save</button>
>            <button type="reset" id ="btnCancel" name="Reset">Cancel</button>
>        </div>*@
>    </fieldset>
>
> </form>
>
>So, as you see, I don't display these 4 fields.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform