473,785 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open new window in codebehind and add the window handle to javascript array

RJN
Hi

In the mainscreen I have a datagrid and from here I open new windows on
click of link button. And I'm doing it through RegisterStartup Script

Me.RegisterStar tupScript("PopU p", _
"<script language='JavaS cript'> " & _
"var winOp = window.open('My Screen.aspx', 'test');" + _
"if (winOp != null) winOp.focus();" + _
"</script>")

I want to keep track of the windows that are opened and add the window
handles to a javascript array whenever a new window is opened in the
codebehind. In the .aspx page I should be able to access this array.

var winArray = new Array;// populated in .aspx.vb
function test()
{
for(i=0;i<winAr ray.length;++i)
alert(winArray[i].name);
}

Is there a way to do this?Can this be done through
Page.RegisterAr rayDeclaration?
Thanks

rjn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 2834
Since the window isn't opened until the response is renedered on the client,
you can't get hold of that handle on the server side.

Add JavaScript code to add the window handle to the array on the client side
when the window is opened instead.

--
Patrik Löwendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"

"RJN" <rj*@yahoo.co m> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi

In the mainscreen I have a datagrid and from here I open new windows on
click of link button. And I'm doing it through RegisterStartup Script

Me.RegisterStar tupScript("PopU p", _
"<script language='JavaS cript'> " & _
"var winOp = window.open('My Screen.aspx', 'test');" + _
"if (winOp != null) winOp.focus();" + _
"</script>")

I want to keep track of the windows that are opened and add the window
handles to a javascript array whenever a new window is opened in the
codebehind. In the .aspx page I should be able to access this array.

var winArray = new Array;// populated in .aspx.vb
function test()
{
for(i=0;i<winAr ray.length;++i)
alert(winArray[i].name);
}

Is there a way to do this?Can this be done through
Page.RegisterAr rayDeclaration?
Thanks

rjn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

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

Similar topics

3
14123
by: J.R | last post by:
I'm trying to determine if a named child window has been opened before opening a new one, however my challenge is that the child window may have been opened from a parent that no longer exists, therefore there is no access to the child window handle. Any ideas? Thanks All.
10
11241
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#" onClick="window.open('/cgi-bin/displayimage.cgi?/store/demo/image.jpg&YOUR+PRODUCT%27<b>S+NAME+GOES', 'fullimage', 'WIDTH=420,HEIGHT=405,status=0')"> The original window should not reload, but is, and I have tested it with both version 4.72 and 7.02, and they both do it. IE does not do it....
3
24716
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The situation is: A main window opens child windows one at a time as the user requests, each with its own name. The user may click in any child window or the main window to open a summary window, which has a name all windows know. I want to get that...
3
18856
by: Eric van der Niet | last post by:
Hello all, What i want to do is the following. I want to call a c#.net file from an html page. this htm send some parameters to the C# (asp) file. In Vstudio2003 what kind of file should this be? don't think its a webservice.... And from that point... i would like to open a new page that opens a infopath file... Can someone help me with this one??? i have no clue!
3
7341
by: Michelle Stone | last post by:
hi al i have "variab1 = window.open ("a.aspx", "helloworld"); i do this inside a RegisterStartupScrict ("key", "<script language=javascript>******</script>"); where ***** is hte javascript comman i need to access variab1 from some other forms (to close it from another link from the parent's parent's parent's page). i figured out that the best way to do this is to store this javascript variable in a session variable now comes the...
6
4081
by: Wardeaux | last post by:
I can't find a way to open a new browser window from my codebehind. 1) My page does a postback to the server. 2) On server I evaluate whether to return to existing page or leave existing page displayed and open new window with different page Seems easy enough, I've just not found the key element to make this happen. Anyone found the solution?? MTIA
1
5408
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for that), the popup window will have also a text box and a button. when the User click on the button the value on the textbox will be send back to the textbox on My_WUC. I hope I was clear off what I want to do. I've been searching for some ideas...
7
3675
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses pageA.html 2. User clicks on menu link to open popup.html 3. pageA.html checks if popup.html is already open. It is not, open
5
1408
by: nashak | last post by:
Hello, I have a aspx page on which I have a button. In the click event method in code-behind I do some processing and now need to open a new window in another browser and pass a couple of parameters. I included in my aspx file, the following js function: function OpenChecklist(strCaseID) {
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4045
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 we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.