简体   繁体   中英

MVC3 nested partial views submitt. how does it work?

I have started working with mvc3 pattern and am facing a problem.

The problem statement is some what as follows:

I have a partial view lets say MasterPartial which renders some content and is bound with a model named MasterPartialModel which contains all necessary data to display on that partial view. The MasterPartialView has nested partial views uptill n level and the nested child partial view that renders on demand within the MasterPartialView is bound with ChildPartialView .

Further more, the MasterPartial view has the form tag. Now my question is upon submit which model would i be receiving and upto my understanding it would be the model of the view which has the form declared within it. How would I know if a user makes a change in the data rendered by one of the childviews. How would I get models of the child view which were rendered on demand by the user, or simply how do we cater for this kind of a problem in MVC3 pattern?

Fixed the issue by working around the problem and by using jquery to go through all the loaded partial views. Collected all the values required filled an array of the type of a model and sent that array of models to the controller method for processing. :) jquery i awesome specially if coupled with mvc...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM