vs2005 web application页面中动态添加控件获取属性值 (3)
以上代码是添加控件的,控件的容器是一个panel控件,名称为p1
以下代码是获取值的,因以上的控件是按循环分配的ID号,因此获取此同样按循环先取ID
NameValueCollection coll = Request.Form;
for (int i = 0; i < coll.Keys.Count; i++)
{
DateTime dt = new DateTime();
for (int j = 0; j < 12; j++)
{
string cid = "txt";
if (j < 10)
{
cid += "0" + j.ToString();
}
else
{
cid += j.ToString();
}
if (coll.AllKeys[i].ToString().IndexOf(cid) >= 0)
{
int nums = 0;

[
1] [
2]
[3] [
4] [
5]
