Reputation: 21
I want a left menu bar in my website (C#) on every single page without using any master page. I heard that is possible if I use an .ASCX control on my website. But I don't know how to use this control.
Upvotes: 1
Views: 3486
Reputation: 1605
ASP.NET provides you the ability to create user defined custom controls that are very useful in terms of re-usability. Once you develop a user control, you will feel that it seems like a normal control that are provided by asp.net.
A user control is like an asp.net page with .ascx extension. You have markup and code behind like a normal page. You can put any valid HTML and asp.net build in controls inside the user controls and use it.
Once you are done with control construction, you need to register the control to use it on your website. You can register in on page basis or you can register in web.config file and use it in complete website.
A little search on Google or on SO will provide you more details on the usage of user controls.
Hope this theory will help you and provide some understanding of user control.
Upvotes: 0
Reputation: 1728
.ASCX is Active Server Custom Control. It is used for creating custom controls in asp.net. You can download a menu ascx control from internet and copy paste it in your application. Then in visual studio open your .aspx page in design mode then drag and drop that control on that page from solution explorer. It will automatically add the references to the control in the code and you can use the control.
Upvotes: 1