Closed sathishpsy89 closed 6 years ago
Please make sure that your HTML markup is correct.
Thanks!
Hi, I had tried out in many scenarios and i have attached the code where i implemented,kindly correct the code if there is any wrong in my code.
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master1.master.cs" Inherits="DML_EHRM.Master.Master1" %>
<!DOCTYPE html>
-------------------End Of Html Tag
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.BindMenu();
}
}
protected void rptMenu_OnItemBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater rptSubMenu = e.Item.FindControl("rptChildMenu") as Repeater;
rptSubMenu.DataSource = UDF.FillDataTable("SELECT Parent_Child_ID,Menu_Name,Menu_Url,Menu_Icon FROM dml_menu_setting WHERE Parent_Child_ID =" + ((System.Data.DataRowView)(e.Item.DataItem)).Row[0], false);
rptSubMenu.DataBind();
}
}
private void BindMenu()
{
this.rptMenu.DataSource = UDF.FillDataTable("SELECT Menu_ID, Parent_Child_ID, Menu_Name, Menu_Description, Menu_Url,Menu_Icon FROM dml_menu_setting WHERE Menu_Status=1 AND Parent_Child_Id = 0", false);
this.rptMenu.DataBind();
}
Is there any update regarding this issue
learn to use Github, use a real code block for better code display, it's way to hard to check these lines.
Change your aspRepeater#rptMenu ItemTemplate to this
<ul class="sidebar-menu">
<li class="treeview">
<a href='<%#Eval("Menu_Url") %>'>
<i class='<%#Eval("Menu_Icon") %>'></i>
<span><%#Eval("Menu_Name") %></span>
<ul class="treeview-menu">
<asp:Repeater ID="rptChildMenu" runat="server">
<ItemTemplate>
<li><a href="Master/DD1.aspx"><i class='<%#Eval("Menu_Icon") %>'></i><%#Eval("Menu_Name") %></a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
</a>
</li>
</ul>
You missed the span
around your Menu_Name.
This is still not perfect but should work,
in my opinion you should not repeat to much the <ul class="sidebar-menu">
I would place the repeat without the ul
and try also to add only class="treeview"
if rptChildMenu is filled & if rptChildMenu is not filled don't display class="treeview"
otherwise you can't use the link.
Hi Alma Saeed, It's working, Thansk Alma saeed.
On Nov 29, 2017 5:06 PM, "Raphael Jackstadt" notifications@github.com wrote:
1.
learn to use Github, use a real code block https://help.github.com/articles/creating-and-highlighting-code-blocks/ for better code display, it's way to hard to check these lines. 2.
Change your aspRepeater#rptMenu ItemTemplate to this
You missed the span around your Menu_Name.
This is still not perfect but should work, in my opinion you should not repeat to much the
Hi,
I am happy that i can fetch data from database and load in AdminLTE ( version 2.3.2 & 2.4.0)menu. but i got error while collapsing the menu by clicking the toggle button.