menu控件动态绑定后多生成..................
Menu控件动态绑定后多生成链接产生一条白线怎么移除
多出的HTML代码是这样的:
<A href="http://localhost:3572/Web/TrafficCop/Index.aspx#Menu1_SkipLink"><IMG
style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=0 alt=跳过导航链接 src="台州公安三所三队——交警队_files/WebResource.gif" width=0></A>
Menu控件动态绑定的代码:
public static void AppImageLink(Menu menu, string imageUrl, string departId, string strWhere)
{
StarTech.Police.BLL.DllLinkBll link = new StarTech.Police.BLL.DllLinkBll();
MenuItem menuNode = new MenuItem();
menuNode.ImageUrl = imageUrl;
menu.Items.Add(menuNode);
addchildmenu1(menuNode, departId, strWhere);
}
private static void addchildmenu1(MenuItem node, string departId, string strWhere)
{
StarTech.Police.BLL.DllLinkBll link = new StarTech.Police.BLL.DllLinkBll();
DataSet ds = link.GetAppLink(strWhere);
if (!ds.Tables[0].Rows.Count.Equals(0))
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
MenuItem menuNode = new MenuItem();
menuNode.Text = ds.Tables[0].Rows[i]["linkname"].ToString();
menuNode.Value = ds.Tables[0].Rows[i]["id"].ToString();
menuNode.NavigateUrl = ds.Tables[0].Rows[i]["linkurl"].ToString();
menuNode.Enabled = true;
menuNode.Selectable = true;
node.ChildItems.Add(menuNode);
addchildmenu2(menuNode, menuNode.Value, departId);
}
}
}
private static void addchildmenu2(MenuItem node, string strID, string departId)
{
StarTech.Police.BLL.DllLinkBll link = new StarTech.Police.BLL.DllLinkBll();
DataSet ds = link.GetAppLink(" pid=" + strID + " and departid=" + departId);
if (!ds.Tables[0].Rows.Count.Equals(0))
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
MenuItem menuNode = new MenuItem();
menuNode.Text = ds.Tables[0].Rows[i]["linkname"].ToString();
menuNode.Value = ds.Tables[0].Rows[i]["id"].ToString();
menuNode.NavigateUrl = ds.Tables[0].Rows[i]["linkurl"].ToString();
menuNode.Enabled = true;
menuNode.Selectable = true;
node.ChildItems.Add(menuNode);
}
}
}