嗨,我是 J Query 的新手,在我的项目中,我想从 C# 代码后面实现 J Query Accordion,但我不知道如何使用以下代码向 jquery Accordion 添加控件,但这会将控件添加到 Accordion 选项卡而不是内容
下面是aspx的代码
<script type="text/javascript">
$(function () {
$("#accordion").accordion({
heightStyle: "content"
});
});
</script>
<div id="accordion" runat="server">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<h3>
<%# DataBinder.Eval(Container.DataItem, "Mobile_Name")%>
</h3>
<div>
<p>
<%# DataBinder.Eval(Container.DataItem, "Description")%>
</p>
</div>
</ItemTemplate>
</asp:Repeater>
</div>
以下 .cs 代码
TextBox txtEmail = new TextBox();
txtEmail.ID = "txtEmail";
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString);
SqlDataAdapter da = new SqlDataAdapter("select * from Mobile", con);
DataSet ds = new DataSet();
da.Fill(ds);
Repeater1.DataSource = ds;
Repeater1.DataBind();
accordion.Controls.Add(txtEmail);
请告诉我解决方案谢谢