I'm build a .aspx page which has a textbox and a button on it. When I click the button, I want to open a new window with the text in the textbox as parameter(query string). What I did is RegisterJavaScipt() in the Page_Load, and add a OnTextChanged of the textbox as follows:
Then the result turns out like this:
After I key in something in the txtID textbox and click the button, nothing happened. Only when I refresh the page and then click again, the open window will pop up.
And after I change the value in the textbox and click the button again, I noticed the parameter passed is still the old one.
How to get the most updated value in the textbox and pass it as a parameter? Anyone can help me? Thanks a million.
Code:
protected void TextChanged(Object sender, EventArgs e)
{
string link = "/***/***.aspx";
btnA.OnClientClick = "javascript:General_PopUpWindow('newwindoe','"+txtID.ToString()+"','"+ link +"', '810', '600', '200', '200');return false";
}
Then the result turns out like this:
After I key in something in the txtID textbox and click the button, nothing happened. Only when I refresh the page and then click again, the open window will pop up.
And after I change the value in the textbox and click the button again, I noticed the parameter passed is still the old one.
How to get the most updated value in the textbox and pass it as a parameter? Anyone can help me? Thanks a million.