Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
actuaaly i got a problem
how can i show two view one main view and second partial view
main view in like
@model Person.Persondata


and second partial view is
@model ienurable<person.persondata>


how can we display second partial view in main page ?
Posted

Hi,

You can pass a different model to your partial view.

Within your main page, add the following:

C#
<% Html.RenderPartial("ViewName", viewModelObject); %>


In your main page you'll need access to the model for the partial view. Just pass it in when you render the partial view.
 
Share this answer
 
v3
Comments
member60 18-May-12 6:46am    
My 5!
VJ Reddy 18-May-12 8:33am    
My 5!
 
Share this answer
 
Comments
VJ Reddy 18-May-12 8:34am    
Good references. 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900