By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,977 Members | 1,610 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,977 IT Pros & Developers. It's quick & easy.

Controlling menu controls

P: 58
Hi all,

I'm having a perplexing problem with my menu control using asp.net. Basically, I want a menu control that behaves similar to a Windows menu. For example:

File
- New
- Open
- Save
- Exit

In this instance under Windows, when one clicks on "File", the menu options (submenu) popup and the user can select on New to Exit, but the user cannot choose "File" because it does nothing more than serve as a tool to open the submenu.

I have a asp.net menu control that is similar. On my menu control, however, the "File" part is clickable (and defaults to the current page). I don't want it to be clickable as it is confusing to the user. The text highlights as clickable and when the click on it, in their eyes, nothing happens but a page reload. I simply want that if the user hovers over "File", then the submenu pops up and only the submenu items are clickable.

Here's some sample code:
Expand|Select|Wrap|Line Numbers
  1. <asp:Menu ID="Menu1" runat="server" Font-Names="Arial" Font-Size="10pt" Orientation="Horizontal" Font-Bold="True" StaticDisplayLevels="1" BorderStyle="None">
  2.     <Items>
  3.         <asp:MenuItem Text="File" Value="Trainings">
  4.             <asp:MenuItem Text="New" Value="New" NavigateUrl="NewStuff.aspx"></asp:MenuItem>
  5.             <asp:MenuItem Text="Open" Value="Open" NavigateUrl="OpenStuff.aspx"></asp:MenuItem>
  6.             <asp:MenuItem Text="Save" Value="Save" NavigateUrl="SaveStuff.aspx"></asp:MenuItem>
  7.             <asp:MenuItem Text="Exit" Value="Exit" NavigateUrl="ExitStuff.aspx"></asp:MenuItem>
  8.         </asp:MenuItem>
  9.     </Items>
  10. </asp:Menu>
  11.  
I hope I'm making sense here. Any advice is greatly appreciated.

Robert
Oct 28 '08 #1
Share this Question
Share on Google+
3 Replies


Curtis Rutland
Expert 2.5K+
P: 3,256
I don't think you will be able to make it "unclickable" but you might be able to edit the CSS to make the cursor appear normal and the background/foreground stay the same.
Oct 28 '08 #2

P: 58
Yup. Style sheets did it. You're right in that it's still clickable (a hyperlink), but it's hidden from the user that it's a hyperlink because the link doesn't highlight or anything that draws attention to it.

Thanks for the help!

Robert
Oct 28 '08 #3

Curtis Rutland
Expert 2.5K+
P: 3,256
No prob, Rob.

Hey, that rhymed ;D
Oct 28 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.