|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Menu Control - Templatesimplement the ability to select. If I do something like the following I lose the ability to select. <table cellpadding=4 cellspacing=0 border=1> <tr> <td> <%# Eval("Text") %></td> <td>Next</td> </tr> </table> Thanks Jay Hi Jay,
Welcome. As for the MenuItem's staticItemTemplate problem, I've just performed some tests through the template html you provided and did encouter the problem. Actually when we use custom Static or Dynamic Item template, the asp.net Menucontrol will embeded them in its autogenerated <a href='xxx'> link element... So if you just put some simple element like "<div>....</div>" in the template, you'll find that the select postback still works well... For your scenario, you put an html <table> element, such the clientside click event maybe captured by the <table > element, but did not raise it further to the parent <a> link element , thus, cause the selected post back event not fire.... Currently I've tried use some simple client scripts to manually let the table raise the click event to its parent element and it works well. Here is the test code I used, you can have a test on yoru side to see whether it helps: ======================= <asp:Menu ID="Menu1" runat="server" StaticDisplayLevels="2" OnMenuItemClick="Menu1_MenuItemClick"> <StaticItemTemplate> <div style="background-color:Yellow"> <table cellpadding="4" cellspacing="0" border="1" onclick="this.parentElement.click();"> <tr> <td> <%# Eval("Text") %> </td> ................... ======================= Hope helps. Thanks, Steven Cheng Microsoft Online Support Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) -------------------- | From: "Jay" <Jay@newsgroups.nospam> microsoft.public.dotnet.framework.aspnet.webcontrols:32562| Subject: Menu Control - Templates | Date: Wed, 18 Jan 2006 10:56:25 -0500 | Lines: 23 | X-Priority: 3 | X-MSMail-Priority: Normal | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 | X-RFC2646: Format=Flowed; Original | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 | Message-ID: <uyXFAfEHGHA.***@TK2MSFTNGP12.phx.gbl> | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols | NNTP-Posting-Host: c-24-98-72-48.hsd1.ga.comcast.net 24.98.72.48 | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl | Xref: TK2MSFTNGXA02.phx.gbl Show quoteHide quote | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols | | When I setup a StaticItemTemplate using a HTML table, for example, how do I | implement the ability to select. If I do something like the following I | lose the ability to select. | | <table cellpadding=4 cellspacing=0 border=1> | | <tr> | | <td> <%# Eval("Text") %></td> | | <td>Next</td> | | </tr> | | </table> | | | | Thanks | | Jay | | |
Help with GridView Update w/ Object Data Source needed
XHTML 1.1 and DIV 1 pixel in height ViewState properties and mapped properties don't work well togethe How do I create a custom webcontrol that can have xml inside it's tag? Menu Control and Page Validation Dependent GridViews And CommandArguments how to get changed text from web control textbox Adding errors by hand to a validationsummary? A bug? Transparent Dynamic Item! Dropdownlist causes blank screen |
|||||||||||||||||||||||