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
Post a Comment