Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Views in the same page MVC ASP.NET

I want to display different Views on the same page in ASP.NET MVC technology . How can it be acheived.

I have data coming in from 2 different Tables and for that i have 2 different Views for display. How can I display both these views on one single page.

Is there a concept of a View within a view in MVC ? Or is there some provision for making a master view which can encapsualte multiple views. ?

like image 647
Mangesh Kaslikar Avatar asked Mar 18 '13 13:03

Mangesh Kaslikar


2 Answers

These link's will help you (first gain knowledge of Partial view)

  1. http://www.dotnet-tricks.com/Tutorial/mvc/2IKW160912-Partial-View-in-Asp.net-MVC3-Razor.html
  2. http://www.codeproject.com/Articles/351867/Basics-of-ASP-NET-MVC3-Part-II
  3. http://www.c-sharpcorner.com/UploadFile/aravindbenator/mvc-3-razor-and-partial-view/
like image 122
Satpal Avatar answered Oct 16 '22 08:10

Satpal


ASP.NET MVC supports the ability to define "partial view" templates that can be used to encapsulate view rendering logic for a sub-portion of a page. "Partials" provide a useful way to define view rendering logic once, and then re-use it in multiple places across an application.

Refer:

Re-use UI Using Master Pages and Partials

Creating Partial View

like image 2
Kapil Khandelwal Avatar answered Oct 16 '22 07:10

Kapil Khandelwal