惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
有赞技术团队
有赞技术团队
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
博客园_首页
Y
Y Combinator Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
雷峰网
雷峰网
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Help Net Security
P
Proofpoint News Feed
B
Blog
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

博客园 - DODONG

在现有PDF文件上添加水印 c#获取硬件信息 一个读写csv文件的C#类 . C#操作Excel文件(读取Excel,写入Excel) . 解决全球化时区问题 利用ReportViewer读取Reporting Service数据 查询数据表中重复的记录 CVS文件导入SQL ComponentArt.Web.UI中AJAX TreeView 抽象工厂(Abstract Factory)模式 简单工厂(Simple Factory)模式 工厂方法(Factory Method)模式 用.NET创建Windows服务 关于SharePoint中查询写法和注意的地方 关于&运算符和^ 初识WAP开发时.. C#操作XML XMLHttp客户端操作数据 asp.net网页智能导航SmartNavigation的替代实现方式
[转]用反射来处理多字段提交
DODONG · 2008-04-02 · via 博客园 - DODONG

遍历获取控件上的值

测试用的类

<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" />&nbsp;<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 );
    }