Proper use of tag prefix and tag name?

It looks like both TagPrefix and TagName are required. I am wondering what proper use of each element would be? The code I received below does not look right as I repeat the name of the control twice ...

<%@ Register TagPrefix="ucCustomerSearch" TagName="ucCustomerSearch" Src="~/UserControls/IndividualSearch.ascx"%> <%@ Register TagPrefix="ucCustomerList" TagName="ucCustomerSearch" Src="~/UserControls/CustomerList.ascx"%> <asp:Content ContentPlaceHolderid="PlaceHolderMain" runat="server"> <ucCustomerSearch:ucCustomerSearch Title="Search" runat="server" /> <ucCustomerList:ucCustomerList Title="Customer List" runat="server" /> </asp:Content> 
+4
source share
1 answer

Think of TagPrefix as a namespace. You should use the same thing for both controls, and it could be something like my or the name of your project or something that you really like. But it should not be the same as any of your controls.

+4
source

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


All Articles