我有一个文本框,我更改值取决于在我的DropDownList中选择什么。 目前为止这么好。获取文本框文本,JavaScript已更改
但是,当我想要获取该文本后面的代码时,它不会检索任何内容。 (我知道问题,而不是解决方案)
问题是,我怎样才能得到在JavaScript代码隐藏更新的文本? (我将在下面提交代码示例) (注:这不是我的代码,它只是一个简单的例子)
<asp:Panel ID="AnswerPanel" runat="server" >
<asp:TextBox ID="tbxExample" runat="server" ></asp:TextBox>
</asp:Panel>
<asp:Button ID="btnSend" onClientClick="Example" runat="server" Text="Send" />
的Jquery:
function Example{
$('#tbxExample').val("Test");
}
代码隐藏
string ex = tbxExample.Text; // I want it to say "Test", but it comes out as ""
是一个类型错误,你忘记了函数'Example'上的'()'? – Aristos