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. Advertising

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. Muhammad Mujeeb Farooqi

    Help needed on Javascripting And Asp

    Muhammad Mujeeb Farooqi, Jul 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    377
    Alan Silver
    Jul 28, 2005
  2. Replies:
    0
    Views:
    265
  3. Dittrich

    Javascripting the Webcontrols.Menu

    Dittrich, Jul 18, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    328
    Dittrich
    Jul 18, 2007
  4. Connell

    Cross-subdomain javascripting.

    Connell, Jun 28, 2005, in forum: Javascript
    Replies:
    1
    Views:
    84
    Martin Honnen
    Jun 28, 2005
  5. lisha
    Replies:
    2
    Views:
    147
    shimmyshack
    Nov 13, 2006
Loading...

Share This Page