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.


Menu and Master Page

Menu and Master Page

I'm trying to access menus I placed on a master page. based on user levels I want to show which menu belongs to which level.

On my home page I have the following on the load event.

Dim InqMenu As System.Web.UI.WebControls.Menu = CType(myMaster.FindControl("MenuControl1"), Menu)
InqMenu.Visible = True

I just trying to test with this to display the menu that I set the visible to False.

I get an error saying "unable to cast of type ASP.menucontrol_ascx' to type 'System.Web.UI.Wecontrols.Menu'

I am currently accessing lables on my master page with no problem.

Any help would be appreciated.


RE: Menu and Master Page

Nevermind, got it..

Dim InqMenu As MenuControl = TryCast(myMaster.FindControl("MenuControl1"), MenuControl)

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!


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