correct use of tag prefix and tag name?
Asked Answered
P

1

6

It looks like both TagPrefix and TagName are both required. I'm wondering what the correct usage of each element would be? The code I've got below doesn't 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>
Parthenia answered 26/4, 2010 at 8:45 Comment(0)
A
5

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

Allure answered 26/4, 2010 at 8:47 Comment(2)
would "userControl" be a suitable name?Parthenia
@ForeverDebugging: I would probably go for a shorter name, maybe just uc.Allure

© 2022 - 2024 — McMap. All rights reserved.