Javascripting the Webcontrols.Menu

Discussion in 'ASP .Net Web Controls' started by Dittrich, Jul 18, 2007.

  1. Dittrich

    Dittrich Guest

    Hello,

    In my project, I'm using the standard Webcontrols.Menu on a page. I want to
    be able to manipulate the menuitems with javascript. Therefore, the anchor
    tags that are rendered by the menu need to include an id attribute. How do I
    override the standard rendering of the menuitems so that an id attribute can
    be generated?

    this is wat is generated for a standard menuitem:

    <tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)"
    onkeyup="Menu_Key(this)" id="mainMenun2">
    <td><table class="DynamicMenuItem mainMenu_7" cellpadding="0"
    cellspacing="0" border="0" width="100%">
    <tr>
    <td style="white-space:nowrap;width:100%;"><a class="mainMenu_1
    DynamicMenuItem mainMenu_6" href="main.aspx"
    style="border-style:none;font-size:1em;"><img src="Images/Delete.png" alt=""
    style="border-style:none;vertical-align:middle;" />Delete</a></td>
    </tr>
    </table></td>
    </tr>

    and this is what I want the menuitem to generate:

    <tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)"
    onkeyup="Menu_Key(this)" id="mainMenun2">
    <td><table class="DynamicMenuItem mainMenu_7" cellpadding="0"
    cellspacing="0" border="0" width="100%">
    <tr>
    <td style="white-space:nowrap;width:100%;"><a id="item_21"
    class="mainMenu_1 DynamicMenuItem mainMenu_6" href="main.aspx"
    style="border-style:none;font-size:1em;"><img src="Images/Delete.png" alt=""
    style="border-style:none;vertical-align:middle;" />Delete</a></td>
    </tr>
    </table></td>
    </tr>

    Thanks
     
    Dittrich, Jul 18, 2007
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Howard

    Menu style toolbar using WebControls

    Bob Howard, Feb 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    405
    Curt_C [MVP]
    Feb 18, 2004
  2. =?Utf-8?B?UmljayBTaHVyaQ==?=

    WebControls.Menu in Whidbey not Mozilla compatible?

    =?Utf-8?B?UmljayBTaHVyaQ==?=, Mar 11, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    433
    Brian Henry
    Mar 12, 2005
  3. Muhammad Mujeeb Farooqi

    Help needed on Javascripting And Asp

    Muhammad Mujeeb Farooqi, Jul 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    454
    Alan Silver
    Jul 28, 2005
  4. Jim Duffie

    System.Web.UI.WebControls.Menu

    Jim Duffie, May 14, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    3,824
    Jim Duffie
    May 14, 2006
  5. Replies:
    0
    Views:
    333
  6. Dittrich

    Javascripting the Webcontrols.Menu

    Dittrich, Jul 18, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    387
    Dittrich
    Jul 18, 2007
  7. Connell

    Cross-subdomain javascripting.

    Connell, Jun 28, 2005, in forum: Javascript
    Replies:
    1
    Views:
    144
    Martin Honnen
    Jun 28, 2005
  8. lisha
    Replies:
    2
    Views:
    217
    shimmyshack
    Nov 13, 2006
Loading...