INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Use a label in a Module

Use a label in a Module

(OP)
I'm using a master page with a menu. I have a label on each page that I pass the users "group" to from a session. I'm using that label to build the menu access. I'm trying to do this in a module so I can have the code in one location rather then on each page. how can I build the menu using a module and a session.

any help would be appreciated

Thanks

RE: Use a label in a Module

I would not us a module, they are basically an old school "class". But in this instance I wouldn't use a class either.. I would build a user control that encapsulates all of your menu controls and code logic. That then can be placed on your master page.

RE: Use a label in a Module

(OP)
okay,

I will check that out. hopefully I can find some info on that.

Thanks

RE: Use a label in a Module

(OP)
so, would you put the group session label in the user control as well ?

RE: Use a label in a Module

you can, it depends on what you want to show and where.
A user control is just a control you build with other controls and code on it. The purpose of it is to make blocks of UI and code reusable so you don't have to place the same code on multiple pages. You just place it on any page you want to use it. This way if something changes, it only changes in one place.

RE: Use a label in a Module

(OP)
how do you find the control on the master page ?

Master.FindControl("MenuControl").Visible = False

The above doesn't work.

Thanks

RE: Use a label in a Module

Set a property on the masterpage like showMenu as boolean

On your page (aspx)

CODE

<%@ MasterType VirtualPath="~/<path>/<masterpage>.master" %> 

on your page (vb code)

CODE

Me.master.showMenu = False 

Then on your masterpage, set the control's visible property accordingly

RE: Use a label in a Module

(OP)
okay, so I put a menu control in the master page and also a user ID and group label in the master page as well. I'm trying to avoid checking the group on each page so I want the master page to hold the users group level so I can disable or enable menu options. Is the Menucontrol I created tied to the master page "on load" event ? I can't seem to remove menu items from the master page when a content page gets loaded.

Thanks for helping me with this.

RE: Use a label in a Module

Is the menu control a user control placed on the master page? If so, the usercontrol has it's own events.
It is unclear on what you are trying to do. If you have further questions, you should post your masterpage and usercontrol HTML along with any code behind and explain what exactly you are trying to do.

RE: Use a label in a Module

(OP)
Thanks for the info and pointing me in the right direction. I was able to put all my code under the menu user control that I created.

RE: Use a label in a Module

Great, glad you got it working!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close