473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1804
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
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.