User control
what is the use of user control ?how to use the user control in asp .net?
Know the answer? Post it. Somebody with the same question will find it here.

Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Shivanand ArurRank #920 · 2.3K reputationPosted Sep 24, 2012, 11:32 PM EDT
To add a User Control you can simply right click on the Solution and select "Add" and select "New Item". In the Panel which opens, you select the "Web User Control". You give a Name to it and click on "Add" button. A new User Control page with (.ascx) extension will be added to your solution.
For Example -
I have a Login User Control which has to code in the .ascx file like this....
After creating the User Control, you have to register on the page where you want to use it.
<%@ Register TagName="LoginControl" TagPrefix="login" Src="~/UserControl/LoginControl.ascx" %>
Info -
Here "LoginControl" is the tag name of the LoginControl and you have to give a Prefix to that control as I have given above "login" The Prefix is just the same which we have in our Server Controls as "asp:" and the tag-name is the same as "asp:Panel".
After registering the Control, you can simply drag and drop the control as I have done it inside a Panel -