c# - ViewModel becomes null when passed between actions -
I'm having trouble passing the visual model in one view. I have two ideas: a Say that (I used this method to use multiple At this point, Now The problem is that you can not send data with redirection action. You are redressing a 301 and it goes back to the client. Store it in a tempdata or session ... View the following post: search and see a
normalform . Passes the viewdown of
search search code in
normalform .
GeneralForm is a complex view-model in which two other view models:
public class GeneralFormViewModel {public GeneralInfoViewModel GeneralInfo {get; Set; } Receive Public Notes Vision Model Notes { Set; }} Public Square GeneralInfoViewModel {[Required (ErrorMessage = "Please enter the name of the person.")] [DisplayName ("name:")] Public string name {get; Set; } [Required (Error Message = "Please enter the person's ID.")] [DisplayName ("id:")] Received public ID { Set; }} Public class notes view model {// etc
@ Html.BeginForm s on my GeneralForm view In this way, I hope that a small portion of the entire normal form will be posted and validated using the Knock OutJs and AJX at one go.)
[http post] [Http post] Public activity search search (search vivo model vm) {var query = // in some search Eken var viewmodel = new GeneralFormViewModel () {GeneralInfo = new general Sucnavivemodl {id = query.id, Name = query.name}}; Return Redirect Action ("General Form", Viomodal); }
viewmodel.GeneralInfo is not not , and the void is sent to the General Forms Administrator.
[HTPGet] Public Action Result General Form (Genuine Weave Model Model) {Return View (Model); }
model.GeneralInfo is tap. What are the MVC conferences that I am doing, and how can I get general farm views to present data obtained through search controller in General Farm View?
Comments
Post a Comment