Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually what is a user control in asp net? As per my understanding its a control like grid,textbox,menu,header etc created by user and can use in n number of pages.

i have read article about this but still confused.
If i create a button in my user control page, i can add code for that button there right (in ascx.cs) ?
So how can i add this button in other aspx pages ? And after adding button do i need write any code or it will look for the code which i have written in ascx.cs page for that button?
Posted

You are right, User control is any control which you can create and customize by writing your customize code on it, like a button.

and then you can use that user control with the same functionality in n number of pages.


how you can use a user control in your aspx page for that , Check these links

Creating Reusable Elements with ASP.NET User Controls[^]

Straight way to create ASP.NET user controls library[^]
 
Share this answer
 
Comments
Am Gayathri 17-Dec-14 4:21am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900