ASP.NET/MVC Multiple View Models (Product Page & Reviews) -


i have product view, wanting include corresponding product reviews on same page presented user.

<!---a single product---> <div class="product"> ... </div> <!--many reviews-->  <div class="reviews"> ... </div> 

in order retreive views, productid needed. how pass both productmodel , reviewmodel productpage view?

you can have 1 model per view. can use viewbag make additional information available view.

a better way create new view model, productdetailsviewmodel holds data need, populate in controller , pass view.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -