Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu and Master Page

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
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.

Thanks
 
Nevermind, got it..

Dim InqMenu As MenuControl = TryCast(myMaster.FindControl("MenuControl1"), MenuControl)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top