Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP:menu control question

ASP:menu control question

Scheduled Pinned Locked Moved ASP.NET
questioncsharpjavascripthtmlasp-net
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ChrisFarrugia
    wrote on last edited by
    #1

    Dear All, I would like to implement a horizontal drop down menu in asp.net ..but would like the use the in built menu control so that I will not use javascript. However, I would like to be able to set a different style for each header in the menu. For example the home category may have a green border and some other html, the products category may have a blue border along with some html etc. What I need is to actually make a template for each of the categories. Is this possible with the build in control? Any tips that might put me on the right track? Thanks a lot, Chris

    G J D 3 Replies Last reply
    0
    • C ChrisFarrugia

      Dear All, I would like to implement a horizontal drop down menu in asp.net ..but would like the use the in built menu control so that I will not use javascript. However, I would like to be able to set a different style for each header in the menu. For example the home category may have a green border and some other html, the products category may have a blue border along with some html etc. What I need is to actually make a template for each of the categories. Is this possible with the build in control? Any tips that might put me on the right track? Thanks a lot, Chris

      G Offline
      G Offline
      gauthee
      wrote on last edited by
      #2

      Chris, You can try creating a usercontrol. Create a usercontrol using all your appropriate styles. Later you can use this control in all your web pages by registering the user control in those pages!

      gauthee

      1 Reply Last reply
      0
      • C ChrisFarrugia

        Dear All, I would like to implement a horizontal drop down menu in asp.net ..but would like the use the in built menu control so that I will not use javascript. However, I would like to be able to set a different style for each header in the menu. For example the home category may have a green border and some other html, the products category may have a blue border along with some html etc. What I need is to actually make a template for each of the categories. Is this possible with the build in control? Any tips that might put me on the right track? Thanks a lot, Chris

        J Offline
        J Offline
        Jesse Squire
        wrote on last edited by
        #3

        Hi Chris, It sounds like you're going to be best served by looking into CSS Adapters, which allow you to override the rendering of ASP.NET controls. Scott Guthrie has a good overview [^] that may help you get started. Microsoft has also released some reference adapters[^] and a toolkit [^] that may prove helpful. A google[^] search for ASP.NET CSS Adapters will net you lots of hits. Hope that helps. :)

        --Jesse

        "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi

        1 Reply Last reply
        0
        • C ChrisFarrugia

          Dear All, I would like to implement a horizontal drop down menu in asp.net ..but would like the use the in built menu control so that I will not use javascript. However, I would like to be able to set a different style for each header in the menu. For example the home category may have a green border and some other html, the products category may have a blue border along with some html etc. What I need is to actually make a template for each of the categories. Is this possible with the build in control? Any tips that might put me on the right track? Thanks a lot, Chris

          D Offline
          D Offline
          Declan Bright
          wrote on last edited by
          #4

          The asp.net menu control has a MenuItemDataBound event which allows you to access each menu item as the menu is being databound. As this event triggers you can modify the properties of the menu item as you require.

          protected void MainMenu_MenuItemDataBound(object sender, MenuEventArgs e)
          {
          MenuItem mi = e.Item;
          mi.Text = .... do stuff here ...
          }

          Declan Bright www.declanbright.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups