在.aspx中<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="295px"><Columns><asp:TemplateField HeaderText="状态"><ItemTemplate><asp:DropDownList runat="server" DataValueField="state" ID="DropDownList1"></asp:DropDownList></ItemTemplate></asp:TemplateField></Columns></asp:GridView>在.aspx.cs中DropDownList myDropDownList = (DropDownList)this.GridView1.FindControl("DropDownList1");myDropDownList 值一直为null在智能提示中也找不到DropDownList1
添加回答
举报
0/150
提交
取消