Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC3 ASP.NET4.0
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
 

how can we display second partial view in main page ?
Posted 17-May-12 20:03pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
You can pass a different model to your partial view.
 
Within your main page, add the following:
 
<% 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.
  Permalink  
v3
Comments
member60 at 18-May-12 6:46am
   
My 5!
VJ Reddy at 18-May-12 8:33am
   
My 5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
VJ Reddy at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 470
1 mhegazy94 460
2 Ravi Bhavnani 190
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,135
1 OriginalGriff 6,801
2 CPallini 5,350
3 George Jonsson 3,619
4 Gihan Liyanage 2,797


Advertise | Privacy | Mobile
Web02 | 2.8.140922.1 | Last Updated 18 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100