如何设置Accordion控件中文字的链接地址? - Web 开发 / Ajax
//动态获得菜单
private void ShowMenu()
{
//获得父节点
DataSet dsallparentNodes = MKManage.GetAllParentNodes();
for (int i = 0; i < dsallparentNodes.Tables[0].Rows.Count; i++)
{
AccordionPane ap = new AccordionPane();
Label lblParentMenu = new Label();
//写入父节点
lblParentMenu.Text = " " + Convert.ToString(dsallparentNodes.Tables[0].Rows[i]["MKName"]);
ap.HeaderContainer.Controls.Add(lblParentMenu);
//获得父节点
int parentid = Convert.ToInt32(dsallparentNodes.Tables[0].Rows[i]["RootId"]);
//获得父节点下的子节点
DataSet dschildNodes = MKManage.GetChildNodes(parentid);
for (int j = 0; j < dschildNodes.Tables[0].Rows.Count; j++)
{
//Label lblChildMenu = new Label();
HyperLink hlChildMenu = new HyperLink();
hlChildMenu.Text = " " + "<br>" + Convert.ToString(dschildNodes.Tables[0].Rows[j]["MKName"]) + "<br>";
hlChildMenu.NavigateUrl = Convert.ToString(dschildNodes.Tables[0].Rows[j]["URL"]);
hlChildMenu.Target = "mainFrame";
ap.ContentContainer.Controls.Add(hlChildMenu);
}
Accordion1.Panes.Add(ap);
}
为什么链接设了却没有效果?还可以用别的方法解决吗?
------解决方案--------------------
调试一下,看看hlChildMenu.NavigateUrl到底有没有值