<head runat="server">
<title></title>
<script type="text/javascript">
var num = 1;
var str = "";
function AddControl() {
if (num < 7) {
str = "<div id=" + num + " style='margin-top:10px'><span>请添加参数" + num + "</span>";
str += "<span><input id='Txt_" + num + "' type='text' name='Txt_" + num + "' /></span><span ><input id='sub_" + num + "' type='submit' value='删除 ' onclick='return Hide(" + num + ")' /></span><div>";
document.getElementById("upload").innerHTML += str;
document.getElementById("hf").value = num;
if (num < 7) {
num++;
}
}
return false;
}
function Hide(num) {
document.getElementById(num).style.display = "none";
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="hf" type="hidden" name="hf" />
<div id="up" style="margin-top: 10px">
<span>请添加参数</span> <span>
<input id="Txt_0" type="text" name="Txt_0"/></span><span>
<input id="sub_0" type="submit" value="添加" onclick="return AddControl()" />
</span><span>
<asp:Button ID="Button1" runat="server" Text="插入" OnClick="Button1_Click" /></span></div>
<div id="upload">
</div>
</form>
</body>
</html>
使用DOM可以操作。