62,046
社区成员
发帖
与我相关
我的任务
分享
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<%# Eval("chexi") %><br />
<%# Eval("cartype") %><br />
<asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("id") %>' />
<asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label>
<%
int a = Convert.ToInt32((Repeater1.Items[0].FindControl("Label1") as HiddenField).Value);
string sql = "select * from car_chexing where fatherid=" + a;
(Repeater1.FindControl("DropDownList1") as DropDownList).DataTextField = "chexing";
(Repeater1.FindControl("DropDownList1") as DropDownList).DataValueField = "chexing";
(Repeater1.FindControl("DropDownList1") as DropDownList).DataSource = DBHelp.GetTable(sql); ;
(Repeater1.FindControl("DropDownList1") as DropDownList).DataBind();
%>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</ItemTemplate>
</asp:Repeater>