explain about <%@ Register TagPrefix%> atributes in aspx page [Resolved]

Posted by Maheshvishnu under ASP.NET on 9/21/2012 | Points: 10 | Views : 16332 | Status : [Member] | Replies : 1
explain about <%@ Register TagPrefix="" TagName="'%> attributes in aspx page



Posted by: Tanujad on: 9/21/2012 [Member] Starter | Points: 50


Register directive is a directive used for registering a user defined control on a web page.

A user control may be embedded in an aspx web page using the @Register directive. A user control cannot be executed on its own independently, but it may be registered
on a web page and then used.

Syntax for registering a user control --
<%@ Register TagPrefix="UC1" TagName="UserControl1" Src="AddEmployeeControl.ascx" %>

TagPrefix attribute is used to specify a unique namespace for the user control.
TagName is used to refer a user control uniquely by its name.

When we want to use this control in a webpage, we may use the following line of code --
   <UC1:UserControl1 runat="server" />

Please mark as answer if it solves your query.

(If this content helped you, Please mark it as Answer)

Maheshvishnu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response