Ya Ri

Ya Ri

  • 1.9k
  • 64
  • 730

ASP.net on Mouse click submenu items should appear

Jan 30 2021 1:28 AM
In my web application ,ASP. Net Menu item control pops up when using mouse-over on desktop but touchscreen could be a problem. If user uses mouse over the ASP.net Main menu ,the main menu and submenus pops up in desktop after using disappearafter =999 and selectable =true in menu control. when I tap the main menu using touch screen devices, submenu disappears before selecting.
How to write mouse click instead of mouse over in asp.net menu item and will it work for both desktop/touch screen devices. Any help is appreciated.
 
 This is my code
 
<asp:Menu ID="menu1" runat="server" Font-Bold="True" Font-Italic="False" DynamicHorizontalOffset="1" Disappearafter=""999" Font-Names="Verdana" Font-Size="14px" ForeColor="White"
StaticSubMenuIndent="20px" CssClass="menu1" Height="32px" Orientation="Horizontal" Font-Strikeout="False" Font-Underline="False">
<DynamicMenuItemStyle Width="100px" HorizontalPadding="1px" VerticalPadding="3px" />
<Items>
<asp:MenuItem Text="Home" Value="Home" NavigateUrl="Home.aspx"></asp:MenuItem>
<asp:MenuItem Text="Books" Value="Books">
<asp:MenuItem Value="Create a Book" NavigateUrl="Createbook.aspx"></asp:MenuItem>
<asp:MenuItem Value="Create a Book" NavigateUrl="Create a Book"></asp:MenuItem>
<asp:MenuItem Value="Edit a Book" NavigateUrl="Edit a Book.aspx"></asp:MenuItem>
<asp:MenuItem Value="Delete a Book" NavigateUrl="Delete a Book.aspx" ></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Enquiry" Value="Enquiry">
<asp:MenuItem Value="Status Enquiry" NavigateUrl="~/StatusEnquiry.aspx"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Order" Value="Order">
<asp:MenuItem Value="Order" NavigateUrl="~/Order.aspx"></asp:MenuItem>
<asp:MenuItem Value="Return Books" NavigateUrl="~/Return Books.aspx"></asp:MenuItem>
</asp:MenuItem>
</Items>
<StaticSelectedStyle CssClass="menu2" BorderStyle="Solid" BorderWidth="1px" BorderColor="White" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="1px" VerticalPadding="8px" Width="120px" BorderStyle="Solid" BorderWidth="1px" />
<DynamicHoverStyle BackColor="#079DF8" ForeColor="White" />
<DynamicMenuStyle BackColor="#2D6FD2" />
</asp:menu>
 

Answers (3)