473,508 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

close subwindow using vb.net

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
Nov 18 '05 #1
1 1815
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.
"Marcel" <ma************@REMOVEMEmsn.com> wrote in message
news:uQ**************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6723
by: Venkat | last post by:
Hi All, I have got two windows namely parent and a child . My parent window has got a link, on clicking which opens a child window(i am using window.open function). I do the following set...
2
1950
by: Paul Moffitt | last post by:
We have a Javascript function that opens an electronic document in a subwindow. The Title bar of the subwindow shows the filepath of the document. Looking at the script below is there any way to...
1
5482
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
1
394
by: Marcel | last post by:
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...
3
1787
by: Marcel Balcarek | last post by:
I have a sub-window. When I click 'OK' I want to: post back to to my server code, persist some data and close the sub-window. I don't know how to close the subwindow in server code. Marcel
35
11338
by: Eric Sabine | last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET connection object, SQLConnection to be exact) and then I came across the following in some microsoft code. If Not cn Is Nothing...
6
4181
by: Wolf Grossi | last post by:
Greetings, how to refresh a parent window after processing forms from the subwindow? Currently I have a solution (see below) which works with IE and Konqueror, but not with Firefox, so I...
2
1554
by: nicofari | last post by:
Hi all, I would need to open a "subwindow of a subwindow". From first page (say "main.html") I open a window using javascript window.open('form1.html',...) After that I have two browser...
5
2338
by: digory | last post by:
Hi Our product consists of a complex application that is written in C/C++ and uses the old event-based Win32 API (some code has already been in there in times of Windows 3.11!) We cannot afford...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7391
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.