我要完成的功能是,
现在有一个表单,在表单上,有一个按钮,一点击按钮就会有动态增加一组表单项,有文本框,也有下拉列表,是html控件。
还有一个按钮,是提交,我如何在另外一个页面中得到我这些动态添加表单项的值呢。
下面是我动态添加的值,它可以实现动态添加function addFile(max)  
         {
             var Text1 = document.getElementsByName("Text1");  
             if (Text1.length == 1 && Text1[0].disabled == true)  
            {  
                Text1[0].disabled = false;  
                return;  
            }  
            if (Text1.length < max)  
            {  
                var fileButton = '<br /> <table width="550" border="0" cellspacing="0" cellpadding="0" align="center" >';
                    fileButton += '<tr>';
                    fileButton += '<td colspan="4" class="table_clew" valign="middle">教育经历(自最高学历填起)</td>';
                    fileButton += '</tr>';
                    fileButton += '<tr>';
                    fileButton += '<td colspan="4" class="table_left_clew">请选择教育类型:';
                    fileButton += '<select name="EduType"+Text1.length+" " style="width:120px" dataType="Require"  msg="请选择您的教育类型!" id="EduType">';
            fileButton += '<option value="">请选择教育类型</option>';
                fileButton += '<option value="普通高等教育">普通高等教育</option>';
            fileButton += '<option value="高等教育自学考试">高等教育自学考试</option>';
            fileButton += '<option value="成人高等教育">成人高等教育</option>';
            fileButton += '<option value="职业技术教育">职业技术教育</option>';
            fileButton += '<option value="无">无</option>';
                fileButton += '</select>';
                fileButton += '</td>';
                    fileButton += '</tr>';
                    fileButton += '<tr>';
                fileButton += '<td width="60" class="table_left_clew">毕业学校:</td>';
                fileButton += '<td class="table_left_clew" colspan="3">';
                fileButton += '<input type="text" dataType="Limit"msg="请正确输入您的毕业学校!" max="30" min="4" name="SchoolName" id="SchoolName" maxlength="20" >';
                fileButton += '</td>';
                    fileButton += '</tr>';                 fileButton += '<tr>';
            fileButton += '<td class="table_left_clew">学  历:</td>';
            fileButton += '<td class="table_left_clew">';
        fileButton += '<select name="schoolage" style="width:80px" dataType="Require"  msg="请选择您的学历!" id="schoolage">'; 
        fileButton += '<option>请选择</option>';
                    fileButton += '<option value="研究生">研究生</option>';
                    fileButton += '<option value="大本" >大本</option>';
                    fileButton += '<option value="大专">大专</option>';
                    fileButton += '<option value="中专">中专</option>';
                    fileButton += '<option value="中技">中技</option>';
                    fileButton += '<option value="高中">高中</option>';
                    fileButton += '</select>';
        fileButton += '</td>';
                fileButton += '<td class="table_left_clew">学  位:</td>';
            fileButton += '<td class="table_left_clew">';
        fileButton += '<select name="Degree" id="Degree" dataType="Require" style="width:80px"  msg="请选择您的学位!">';
                    fileButton += '<option>请选择</option>';
                    fileButton += '<option value="博士">博士</option>';
                    fileButton += '<option value="硕士">硕士</option>';
                    fileButton += '<option value="学士">学士</option>';
                    fileButton += '<option value="无">无</option>';
                    fileButton += '</select>';
            fileButton += '</td>';
            fileButton += '</tr>';
            fileButton += '<tr>';
                    fileButton += '<td class="table_left_clew">专业名称:</td>';
            fileButton += '<td class="table_left_clew"><input name="Spec" type="text" maxlength="10" id="Spec" dataType="Limit" msg="请正确输入您的专业名称!(字数大于1小于等于10)" max="10" min="1"></td>';
            fileButton += '<td class="table_left_clew">研究方向:</td>';
            fileButton += '<td class="table_left_clew"><input name="SpecD" type="text" maxlength="10" id="SpecD" /></td></tr>';
            fileButton += '</table>';  
                //alert(fileButton);  
                document.getElementById("FileList").insertAdjacentHTML("beforeEnd",fileButton);  
            }  
        }  
  
    </script>

解决方案 »

  1.   

    取不到。用Request.Form["**"]取不到
      

  2.   

    <asp:Button ID="Button1" runat="server" Text="Button" 
                onclick="Button1_Click" />
            protected void Button1_Click(object sender, EventArgs e)
            {
                string test = Request.Form["schoolage"];
                Response.Write(test);
            }
    可以取得到的啊!!
      

  3.   

    A页面: <form id="form2" name="form1" method="post" action="log.aspx">
        <table width="433" border="0" cellspacing="0" cellpadding="5">
            <tr>
                <td align="right" class="fontblackb" style="height: 30px; width: 120px;">
                    用户名:
                </td>
                <td>
                    <input name="LogName" type="password" id="Password1" size="20" maxlength="20" style="width: 150px;
                        height: 15px;" />
                </td>
                <td align="left" style="height: 30px">
                </td>
            </tr>
            <tr>
                <td align="right" class="fontblackb" style="width: 120px">
                    密码:
                </td>
                <td align="left">
                    <input name="LogPass" type="password" id="Password2" size="20" maxlength="20" style="width: 150px;
                        height: 15px;" />
                </td>
                <td align="left">
                </td>
            </tr>
            <tr>
                <td>
                    <input name="login" type="submit" value="提交" />
                </td>
            </tr>
        </table>
        </form>
    log.aspx  if (HttpContext.Current.Request.Form != null) 

                  System.Collections.Specialized.NameValueCollection   nvs=Request.Form;   
                  string  logname=nvs["LogName"].ToString();
                  string  logpass=nvs["logpass"].ToString();
      

  4.   

    可以用传参数的办法传值,或是用AJAX 发送XML传值
      

  5.   

    兄弟们,看好了,我的表单控不是直接写在<body></body>中的,是用javascript生成的,所以在第二个页面中根本就取不出来啊。
      

  6.   

    在前段用document.genelementByid("服务器端控件的id").value=document.genelementByid("生成控件的id").value
    在后台用  string a=服务器端控件的id.text.Tostring() 获取它的值