How to simulate a partial view in asp.net?

I have been working on the Asp.net website (for a while) based on the MVC background. How do I imitate partial representations in Asp.net? Am I using web user controls or web part zones or others?

+3
source share
4 answers

ASP.NET is actually the base engine for ASP.NET Webforms and ASP.NET MVC.

If you are used to MVC, you really need to use ASP.NET MVC, where Partial Views are first class citizens.

Use ASP.NET MVC

To use it, you simply create a new MVC project, right-click on the shared folder in the View folder and select Add New View. From there you can select Partial View.

Webforms

-, UserControls. webforms MVC, UserControls .

, - Sharepoint... .

+2

- ASP.NET WebForms ASP.NET MVC.

+1

, - ASP.NET, ASP.NET MVC, . - UserControls (.ascx) .

, , . , , .

MVC . , , MVC. , , .

webforms.

aspx:

<%@ Register Src="UserControls/PersonSearch.ascx" TagName="PersonSearch" 
    TagPrefix="uc1" %>

, :

<uc1:PersonSearch hid="ucPersonSearch" runat="server">
</uc1:PersonSearch>

, , ..

, , , . , . , .

, "" ():)

+1

- . , . , MVC ASP.NET .

+1
source

Source: https://habr.com/ru/post/1796167/


All Articles