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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Close Popup with ASP.NET 1

Status
Not open for further replies.

katun

Programmer
Nov 2, 1999
19
0
0
US
I have a very simple question. What command can I use from a ASP.NET sub routine to close a popup window. In JavaScript Self.Close() would work but I can not find any equivilent in ASP.NET.

Bill Guttman
 
Bill,

you're going to need javascript for this as well.

I've used window.close() myself, and that works no problem (just add the attribute to whatever close button you want).

Jack
 
But how can I combine JavaScript and ASP.NET. I need to update a table which I do with vbscript but I also need to close the window which can only be done in JavaScript. Is there a way to chain the two scripts together.
 
ok, if I'm following you, you want to do this (tell me if I'm off):

You have a button. When the button is clicked, you want the table to be updated and the window to close.

If this is the scenario, not a problem. Just add this line

Button.Attributes.Add("onClick", "javascript:window.close()")

That takes care of the window closing. Now, in your code behind, just write the code to update the table in the button's _Click sub. Both will fire when the button is clicked.

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top