Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass in parameter to open a new window

Status
Not open for further replies.

coospaa

Programmer
May 1, 2003
33
SG
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:

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top