c# - ViewModel becomes null when passed between actions -


I'm having trouble passing the visual model in one view. I have two ideas: a search and see a normalform . Passes the viewdown of search search code in normalform .

Say that 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

(I used this method to use multiple @ 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); }   

At this point, 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); }   

Now 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?

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:

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -