1个回答
展开全部
<div id="put_box">js动态添加的控件在这里
<input /><input />
</div>
<asp:button onclientclick="getCount()" ...>
<input id="hd_count" type="hidden" runat="server" />
<script>
function getCount(){
document.getElementById("hd_count").value = document.getElementById("put_box").getElementsByTagName("INPUT").length;
}
</script>
.cs
int count = int.Parse(hd_count.Value);
<input /><input />
</div>
<asp:button onclientclick="getCount()" ...>
<input id="hd_count" type="hidden" runat="server" />
<script>
function getCount(){
document.getElementById("hd_count").value = document.getElementById("put_box").getElementsByTagName("INPUT").length;
}
</script>
.cs
int count = int.Parse(hd_count.Value);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询