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 21: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 Peter Leow 255
1 Mika Wendelius 235
2 CHill60 200
3 Zoltán Zörgő 178
4 Rob Philpott 170
0 Sergey Alexandrovich Kryukov 8,658
1 OriginalGriff 6,591
2 Peter Leow 3,982
3 Zoltán Zörgő 3,604
4 Richard MacCutchan 2,510


Advertise | Privacy | Mobile
Web03 | 2.8.150123.1 | Last Updated 18 May 2012
Copyright © CodeProject, 1999-2015
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