asp:Menu, DynamicItemTemplate and formating text

Discussion in 'ASP .Net Web Controls' started by Jerry C, May 2, 2007.

  1. Jerry C

    Jerry C Guest

    I am working with a asp:menu the NavigateURL is blank I want the menu to
    postback . I am using the DynamicItemTemplate. The simple form for the
    template is

    <DynamicItemTemplate>
    <b><%# Eval("Text") %></b> <br /> <%#Eval("ToolTip")%>
    </DynamicItemTemplate>

    and it look like this for example

    Text dkd kdk
    ToolTip alkd alkdj fl adjla l dfjaldkfja la dfaldfka laskdflas dflajdf a
    aldkjfal ajdf

    This works great but I want to format the text in the ToolTip so I can set
    the width and allow it to wrap. So it would look like this

    Text dkd kdk
    ToolTip alkd alkdj fl adjla l dfjaldkfja la dfaldfka
    laskdflas dflajdf a aldkjfal ajdf


    Code in the dynamicItemTemplate like this formats ok but when I click in the
    tooltip text the menu does not work. when I click in the text section it
    works OK.


    <DynamicItemTemplate>
    <b><%# Eval("Text") %></b> <br />
    <table Width=250><tr><td width=250> <%#Eval("ToolTip")%> </td></tr></table>
    </DynamicItemTemplate>

    Thank you
    --
    Jerry
    Jerry C, May 2, 2007
    #1
    1. Advertising

  2. Hi Jerry,

    Regarding on the ASP.NET Menu control's dynamiItemTemplate postback issue,
    it is due to the html <table/> element will suppress the click event at
    client-side, somewhat related to the client-side webbrowser's
    implementation when there is html <table> nested inside html <a> link
    element.

    So far I have tested a means to overcome this behavior. You can add a
    javascript statement in your html table element's "onclick" client-side
    handler which programamtically trigger the parent element(the postback link
    generated by ASP.NET menu control). Here is the code snippet:

    =====================
    <asp:Menu ID="Menu1" .............>

    <DynamicItemTemplate >
    <b><%# Eval("Text") %></b>

    <table Width="250" onclick="this.parentNode.click();">
    <tr><td width="250"> <%#Eval("ToolTip")%> </td></tr></table>
    </DynamicItemTemplate>
    =======================

    You can have a test on your side to see whether it works.

    Hope this helps.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================



    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], May 3, 2007
    #2
    1. Advertising

  3. Jerry C

    Jerry C Guest

    Steven,

    Thank you that works great.


    --
    Jerry


    "Steven Cheng[MSFT]" wrote:

    > Hi Jerry,
    >
    > Regarding on the ASP.NET Menu control's dynamiItemTemplate postback issue,
    > it is due to the html <table/> element will suppress the click event at
    > client-side, somewhat related to the client-side webbrowser's
    > implementation when there is html <table> nested inside html <a> link
    > element.
    >
    > So far I have tested a means to overcome this behavior. You can add a
    > javascript statement in your html table element's "onclick" client-side
    > handler which programamtically trigger the parent element(the postback link
    > generated by ASP.NET menu control). Here is the code snippet:
    >
    > =====================
    > <asp:Menu ID="Menu1" .............>
    >
    > <DynamicItemTemplate >
    > <b><%# Eval("Text") %></b>
    >
    > <table Width="250" onclick="this.parentNode.click();">
    > <tr><td width="250"> <%#Eval("ToolTip")%> </td></tr></table>
    > </DynamicItemTemplate>
    > =======================
    >
    > You can have a test on your side to see whether it works.
    >
    > Hope this helps.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    Jerry C, May 4, 2007
    #3
    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. Dmitri Manushin

    Formating text

    Dmitri Manushin, Aug 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    381
    Dmitri Manushin
    Aug 14, 2003
  2. Phl
    Replies:
    0
    Views:
    627
  3. djc
    Replies:
    2
    Views:
    423
    William F. Robertson, Jr.
    Dec 10, 2004
  4. Newbie
    Replies:
    5
    Views:
    480
    andreas
    Oct 4, 2004
  5. ErwinP
    Replies:
    1
    Views:
    878
    ErwinP
    Nov 11, 2008
Loading...

Share This Page