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

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

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