close subwindow using vb.net

M

Marcel

I have a subwindow hich displays a grid. When the user selects a row from
the grid, I wish to store the selected row ID in session state and close the
subwindow, returning focus to the parent (opener).

Normally I would do this in javascript, but I cannot find any client side
intelligence in the grid, so I wish to close the window on the select index
changed event when I return to the server.

I can't remeber how to add an OnLoad attribute to the <BODY> tag - as that
would do it.

Please help.
Marcel
 
B

Bruno Sirianni

For do this normally I use the RegisterClientScriptBlock() method of Page.

Example :
string s = "<script>window.close();</script>";
RegisterClientScriptBlock("close", s);

If you want to put code in onload you can make body runat=server and then
declare this in your page as generic HtmlControl so you can write :
html.Attributes["OnLoad"] = ".....";

you can write all your javascript here, or call a function and then put it
on client with RegisterStartupScript method (the use is similar to
RegisterClientScriptBlock)!

Brun.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top