abennett10
asked on
ASP.net (vb.net) Sub routine that can be used throughout the application
Hello Guru's!
How can I create a subroutine in asp.net\vb.net that I can use throughout my application?
For example,
I want to create a usercontrol that I can use as a standard tool bar on all of my pages that let's you know who is logged in and give the logoff button option.
How would I do this?
Thanks in advance!
How can I create a subroutine in asp.net\vb.net that I can use throughout my application?
For example,
I want to create a usercontrol that I can use as a standard tool bar on all of my pages that let's you know who is logged in and give the logoff button option.
How would I do this?
Thanks in advance!
The user control should be created as an ascx file (a "user control" file). You can then drag the user control onto any (or all) of your pages (assuming you're using Visual Studio). This will register the control in the HTML portion of your page, and instantiate the control.
BTW: generally, you should post to the ASP .Net topic area for ASP .net questions.... :)
BTW: generally, you should post to the ASP .Net topic area for ASP .net questions.... :)
ASP.NET topic area:
https://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/
Bob
https://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/
Bob
ASKER
Sorry about that, I'll make sure I post this in the asp.net section of the forum.
What code do I use to create a new instance of the control, and make sure that it is sized how I needed?
What code do I use to create a new instance of the control, and make sure that it is sized how I needed?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will give that a try!
Thank you
Thank you
1. In the Page_Load method of each page, create a new instance of the control, and then add the control to the page.
2. You can store user information in session variables, so that any page throughout the application can access the information and use it to display data on the control.
_______________
Nayer Naguib