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!

Stop refresh on click to open window

Status
Not open for further replies.

stephenk1973

Technical User
Jun 11, 2003
246
GB
I have a java scitpt to open a window on the click of a image button, but when clicked the new window opens but the original screen refreshes. How can i stop this.

Code as below.

Thanks

Stepehn

Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click


Response.Write("<script language = javascript>window.open('HelpInfo.aspx',null,'height=250, width=450,status= no, resizable= no, scrollbars=yes, toolbar=no,location=no,menubar=no' ); </script>;")

End Sub
 
Firstly, dont use Response.Write to register javascript (use RegisterClientScriptBlock or RegitserStartUpScript). Secondly, you'll have to add the javascript function on the page load event, not on the click of a button.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top