asp.net - Hidden set in the view but null in controller -


I try to get a value in my controller, it is set in the view (in the hidden area), but Once the posting area is zero, my model:

  public partial class customer {public full customer ID {receive; Set; } Public String CompanyName {get; Set; } Public int? Customer Adwords Id {Received; Set; } [Foreign Key ("Customer IDS")] {Receive Public Virtual Customer Subscriber Customer Record; Set; } Public int? Receive customer edderbid { Set; } [External ("Customer AddressBilling ID")] Public Virtual Customer Updating Consumer OfficerBilling {Receive; Set; } Public int? Receive Customer Bank ID { Set; } [Foreign Key ("Customer BankID")] Public Virtual Customer Bank Customer Bank {Receipt; Set; } Public virtual iconging & lt; Customer Link & gt; Receive customer link { Set; }}   

My view:

  @using (Html.BeginForm ()) {@ Html.AntiForgeryToken () & lt; div class = "form-horizontal" & gt; & Lt; Hour / & gt; @html Validity valid (true) @html Embedded (model = & gt; Model. Customer ID) @HTML.Heddfor (model = & gt; Model Customer AdWords ID) @HTMLEchidFor (model = & gt; Model Customer EdderBilling ID) @HTML . (Model = & gt; model.CustomerBankId) & lt; Div class = "form-group" & gt; @ Html.LabelFor (model = & gt; model.CompanyName, new {@class = "control-label col-md-2"}) & lt; div class = "col-md-10" & gt; @ Html.TextBoxFor (model = & gt; model.CompanyName, new {@class = "form-control"}) @ html.ValidationMessageFor (model => model.CompanyName) & lt; / Div & gt; & Lt; / Div & gt; & Lt; div class = "form-group" & gt; & Lt; Div class = "col-md-offset-2 col-md-10" & gt; @Html.exeNlink ("Address", "EditEdder", New {ID = Model. CustomRead}, @html.action links (html linking links) new {@class = "btn btn-default"}) @HTMLconnect (" New {id = model.customer id}, new {@class = "btn btn-default"}) @ Html.ActionLink ("Bank Details", "EditBank", New {ID = Model}, "Billing Address", "Edit AddressBilling" New {ID = Model.CustomerId}, new {@class = "btn btn-default"}, new {@class = "btn btn-default"}) @ HTMLconnink ("link", "adlink", new {ID = Model.CustomerId} }) & Lt; Input type = "submit" value = "save" class = "btn btn-success" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; }   

and my control method:

  // GET: / client / edit / edit 5 public functioning (int id) {customer customer = _db} GetCustomer (ID); If (customer == blank) {return HttpNotFound (); } See Return (Customer); } [Http post] [validanteforgertin] edit public action razalt (customer client) {if (ModelState.IsValid) {_db.Edit (customer); _db.Save (); Return Redirect Action ("Index"); } See Return (Customer); }   

What is really strange is that the value of the customer ID is not zero in the controller, but I do the same thing with the customer AdWords ID, and this is a zero. any suggestion?

I finally found out, my properties did not fit properly in my model ^^

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -