js代码:
function GetcontrolValue()
{
var newId = "<%=TxtBox1.ClientID%>";
var txt1 = document.getElementById(newId).value;//不加引号
alert(txt1);
}
</script>
服务器控件代码:
<asp:TextBox ID="TxtBox1" runat="server"></asp:TextBox>