I have a textbox that I change values in depending on what's selected in my DropDownList. So far so good.
But when I want to get that text to code behind it retrieves nothing. This is because the server textboxcontrol have not changed its state or information within it.(I know the problem, not the solution)
The question is, how can i get the text that updates with javascript in codebehind? (I will submit a code example below) (NOTE: this is not my code, its just a simplified example)
<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");
}
CodeBehind
string ex = tbxExample.Text; // I want it to say "Test", but it comes out as ""