Multiple Views in the same page MVC ASP.NET

后端 未结 3 1742
青春惊慌失措
青春惊慌失措 2021-01-02 16:01

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 Table

相关标签:
3条回答
  • 2021-01-02 16:33

    Yes, the aspx webforms has the Master page and then you use user controls .ascx files.

    With MVC, the "master page" is by default under

    Views\Shared\_Layout.cshtml  
    

    Now you can also end up using the wonderful Twitter bootstrap and really start to make greater looking layouts with easy to use css etc..

    Your controller can return

    PartialViewResult
    

    as mentioned by the other answers from the others, those links should get you on your way.

    0 讨论(0)
  • 2021-01-02 16:41

    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

    0 讨论(0)
  • 2021-01-02 16:54

    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/
    0 讨论(0)
提交回复
热议问题