<input type="hidden" id="Input1" value="11" />
<asp:Label runat="server" ID="Lb1" Width="200"></asp:Label>
我遇到的问题是怎样把input值赋值给Lb1的控件,不要使用
<input runat="server" type="hidden" id="Input1" value="11" />
麻烦高手了!!
<asp:Label runat="server" ID="Lb1" Width="200"></asp:Label>
我遇到的问题是怎样把input值赋值给Lb1的控件,不要使用
<input runat="server" type="hidden" id="Input1" value="11" />
麻烦高手了!!
其实还是在前台获取
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "document.getElementById('Lb1').innerText = document.getElementById('Input1').value;return false;");
}
<script type="text/javascript">
function SetValue(){
document.getElementById('Lb1').innerText = document.getElementById('Input1').value;
}
</script>