当前位置:编程学习 > C#/ASP.NET >>

asp.net中用AJAX实现折叠菜单(Accordion控件),但是HyperLink跳转页面不起作用,急啊。。。

public void Display() { string sql = "select * from contenttree where upID=3109"; DataTable dt = DataSet(sql).Tables[0]; foreach (DataRow dr in dt.Rows) { AccordionPane ap = new AccordionPane(); Label lblMouth = new Label(); string head = Server.HtmlDecode("<table width='173' height='35' border='0' cellpadding='0' cellspacing='0'><tr><td align='right' background='images/hj_14.jpg'><table width='75%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='h1'>" + Convert.ToString(dr["NodeName"]) + "</td></tr></table></td></tr></table>"); lblMouth.Text = head; ap.HeaderContainer.Controls.Add(lblMouth); int id = Convert.ToInt32(dr["ID"]); string sql2 = string.Format("select * from contenttree where upID={0}", id); DataTable dt2 = DataSet(sql2).Tables[0]; foreach (DataRow dr2 in dt2.Rows) { int id2 = Convert.ToInt32(dr2["ID"]); HyperLink hl = new HyperLink(); string content = Server.HtmlDecode("<table width='85%' border='0' cellspacing='0' cellpadding='0'><tr><td width='20' align='left'><img src='images/hj_10.jpg' width='20' height='9' /></td><td align='left' class='h3'>" + Convert.ToString(dr2["NodeName"]) + "</td></tr></table>"); hl.Text = content; hl.NavigateUrl = string.Format("~/Front/cxzx/hjmd.aspx?id={0}", id2); ap.ContentContainer.Controls.Add(hl); } Accordion1.Panes.Add(ap); } }
追问:你这是改了个啥啊?
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,