Tuesday, September 8, 2009

How to add .ascx control in aspx page?

1)Create .ascx control. eg WebUserControl1.ascx

2)Register that control in aspx page

<%@ Register TagPrefix="web" TagName="WebControl" Src="~/WebUserControl1.ascx"%>

3) And use that control in aspx page by adding bellow line:
web:WebControl ID="cnt" runat="server"

No comments:

Post a Comment