




























遍历获取控件上的值
测试用的类
<asp:Panel ID="Panel1" runat="server" Height="150px" Width="181px">
AA:<asp:TextBox ID="txt_aa" runat="server"></asp:TextBox><br />
BB:<asp:TextBox ID="txt_bb" runat="server"></asp:TextBox><br />
CC:<asp:DropDownList ID="txt_cc" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
</asp:DropDownList><br />
DD:<asp:TextBox ID="txt_dd" runat="server"></asp:TextBox><br />
EE:<asp:TextBox ID="txt_ee" runat="server"></asp:TextBox><br />
FF:<asp:TextBox ID="txt_ff" runat="server"></asp:TextBox><br />
GG:<asp:TextBox ID="txt_gg" runat="server"></asp:TextBox>
</asp:Panel>
<br />
<asp:Button ID="Button1" runat="server" Text="保存" OnClick="Button1_Click" /> <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="获取"/>

protected void Button1_Click(object sender, EventArgs e)
{
object test = new TestClass();
WebUtility.SetObjectValue(this.Panel1, "txt_", ref test);
Response.Write( ((TestClass)test).Aa );
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。