Window.Open / Window.Close question

D

Dave

For some reason, the below lines only work on select machines. All
machines are running IE6. IE SP's and OS's vary. When it doesn't
work, default.aspx (the page that this code is in) opens and closes.
That's all you see. TSReminder.aspx doesn't even open. I'm not sure
what's going on here.

Response.Write("<script
language=javascript>window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no")</script>")

Response.Write("<script language=javascript>window.opener =
self</script>")
Response.Write("<script language=javascript>window.close()</script>")
 
J

John Prado

Dave said:
For some reason, the below lines only work on select machines. All
machines are running IE6. IE SP's and OS's vary. When it doesn't
work, default.aspx (the page that this code is in) opens and closes.
That's all you see. TSReminder.aspx doesn't even open. I'm not sure
what's going on here.

Response.Write("<script
language=javascript>window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no")</script>")

Response.Write("<script language=javascript>window.opener =
self</script>")
Response.Write("<script language=javascript>window.close()</script>")

Your code will fit best if you do:

Put the lines below in a string:

---------------------------------
function OpenWin(){ var win =
window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no");
window.opener = win;
self.close();
}

window.onload = OpenWin;
---------------------------------

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)
---------------------------------

I'm not sure if this kind of script is a good practice in developing
web, I thought that is a weird action to user

:eek:pen a browser wndow:shows another one:closes the opener window

Some situations like yours could easily be fired by this piece of mess
up with window pointers.
 
D

Dave

John,
Thanks for your quick reply, but now I'm even more lost than before.
This is how I interprit your instructions:

<head runat="server">
<title>Untitled Page</title>

<script language="C#" runat="server">

String scriptString = "function OpenWin() ";
scriptString += "{ ";
scriptString += "var win =
window.open('TSReminder.aspx',null,'height=340,width=640,status=no,toolbar=­no,menubar=no,location=no');
";
scriptString += "window.opener = win; ";
scriptString += "self.close(); ";
scriptString += "} ";
scriptString += "window.onload = OpenWin; ";

</SCRIPT>

</head>

This is just full of red squiggly red lines.

You also say:
In your PageLoad do



I'm assuming that you're refering to add it to:

protected void Page_Load(object sender, EventArgs e)
{

}



I also checked Help about Page.RegisterStartupScrips and it says NOTE:
This method is now obsolete. I checked because it also had a red
squggly red line under it.

I'm really hoping that you give me a quick responce like yesterday.

















John said:
Dave said:
For some reason, the below lines only work on select machines. All
machines are running IE6. IE SP's and OS's vary. When it doesn't
work, default.aspx (the page that this code is in) opens and closes.
That's all you see. TSReminder.aspx doesn't even open. I'm not sure
what's going on here.

Response.Write("<script
language=javascript>window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no")</script>")

Response.Write("<script language=javascript>window.opener =
self</script>")
Response.Write("<script language=javascript>window.close()</script>")

Your code will fit best if you do:

Put the lines below in a string:

---------------------------------
function OpenWin(){ var win =
window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no");
window.opener = win;
self.close();
}

window.onload = OpenWin;
---------------------------------

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)
---------------------------------

I'm not sure if this kind of script is a good practice in developing
web, I thought that is a weird action to user

:eek:pen a browser wndow:shows another one:closes the opener window

Some situations like yours could easily be fired by this piece of mess
up with window pointers.
 
D

Dave

Yes. It works fine on my machine and I not only use the Windows Popup
blocker with SP2, but I also use another that comes with a 3rd party
appication. It doesn't work on various others machines.
 
J

John Prado

In .NET 2.0:

protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScritp(...)
}

John,
Thanks for your quick reply, but now I'm even more lost than before.
This is how I interprit your instructions:

<head runat="server">
<title>Untitled Page</title>

<script language="C#" runat="server">

String scriptString = "function OpenWin() ";
scriptString += "{ ";
scriptString += "var win =
window.open('TSReminder.aspx',null,'height=340,width=640,status=no,toolbar=­no,menubar=no,location=no');
";
scriptString += "window.opener = win; ";
scriptString += "self.close(); ";
scriptString += "} ";
scriptString += "window.onload = OpenWin; ";

</SCRIPT>

</head>

This is just full of red squiggly red lines.

You also say:
In your PageLoad do



I'm assuming that you're refering to add it to:





I also checked Help about Page.RegisterStartupScrips and it says NOTE:
This method is now obsolete. I checked because it also had a red
squggly red line under it.

I'm really hoping that you give me a quick responce like yesterday.

















John said:
Dave said:
For some reason, the below lines only work on select machines. All
machines are running IE6. IE SP's and OS's vary. When it doesn't
work, default.aspx (the page that this code is in) opens and closes.
That's all you see. TSReminder.aspx doesn't even open. I'm not sure
what's going on here.

Response.Write("<script
language=javascript>window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no")</script>")

Response.Write("<script language=javascript>window.opener =
self</script>")
Response.Write("<script language=javascript>window.close()</script>")
Your code will fit best if you do:

Put the lines below in a string:

---------------------------------
function OpenWin(){ var win =
window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no");
window.opener = win;
self.close();
}

window.onload = OpenWin;
---------------------------------

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)
---------------------------------

I'm not sure if this kind of script is a good practice in developing
web, I thought that is a weird action to user

:eek:pen a browser wndow:shows another one:closes the opener window

Some situations like yours could easily be fired by this piece of mess
up with window pointers.
 
D

Dave

Thanks Again John for a quick reply. Please keep in mind that I'm
using exactly what you're showing me. If something is in
Brackets...I'm putting Brackets in there as well.


This is what I have:


protected void Page_Load(object sender, EventArgs e)
{
Page.RegisterStartupScripts(Me.Type, [StringScript], True);

}

Below are the comments:

RegisterStartupScripts = (Blue line) - System.Web.UI.Page does not
contain a definition for 'RegisterStartupScripts'.
Me = (Blue Line) - The name 'ME' does not exist in the current context.
[StringScript] = (Redline) - ) expected
True = (Redline) - ; expected


On the HTML Page:

<head runat="server">
<title>Untitled Page</title>

Function OpenWin()
{
var
win=window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no"
window.opener = win;
self.close();
}

window.Onload = OpenWin;
</head>














John said:
In .NET 2.0:

protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScritp(...)
}

John,
Thanks for your quick reply, but now I'm even more lost than before.
This is how I interprit your instructions:

<head runat="server">
<title>Untitled Page</title>

<script language="C#" runat="server">

String scriptString = "function OpenWin() ";
scriptString += "{ ";
scriptString += "var win =
window.open('TSReminder.aspx',null,'height=340,width=640,status=no,toolbar=­no,menubar=no,location=no');
";
scriptString += "window.opener = win; ";
scriptString += "self.close(); ";
scriptString += "} ";
scriptString += "window.onload = OpenWin; ";

</SCRIPT>

</head>

This is just full of red squiggly red lines.

You also say:
In your PageLoad do



I'm assuming that you're refering to add it to:





I also checked Help about Page.RegisterStartupScrips and it says NOTE:
This method is now obsolete. I checked because it also had a red
squggly red line under it.

I'm really hoping that you give me a quick responce like yesterday.

















John said:
Dave wrote:
For some reason, the below lines only work on select machines. All
machines are running IE6. IE SP's and OS's vary. When it doesn't
work, default.aspx (the page that this code is in) opens and closes.
That's all you see. TSReminder.aspx doesn't even open. I'm not sure
what's going on here.

Response.Write("<script
language=javascript>window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no")</script>")

Response.Write("<script language=javascript>window.opener =
self</script>")
Response.Write("<script language=javascript>window.close()</script>")

Your code will fit best if you do:

Put the lines below in a string:

---------------------------------
function OpenWin(){ var win =
window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no");
window.opener = win;
self.close();
}

window.onload = OpenWin;
---------------------------------

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)
---------------------------------

I'm not sure if this kind of script is a good practice in developing
web, I thought that is a weird action to user

:eek:pen a browser wndow:shows another one:closes the opener window

Some situations like yours could easily be fired by this piece of mess
up with window pointers.
 
J

John Prado

The correct call to RegisterStartupScript in .net 2.0 is:

Page.ClientScript.RegisterStartupScript(...)

Two things
1. I mistyped the end of the function, it has an "S" that not supose to
be at the end of the call.
2. Remove the brackets "[...]" from your call

Dude, take a look at C# sintax. Without know the basics you will suffer
a lot.

Good luck

Thanks Again John for a quick reply. Please keep in mind that I'm
using exactly what you're showing me. If something is in
Brackets...I'm putting Brackets in there as well.


This is what I have:


protected void Page_Load(object sender, EventArgs e)
{
Page.RegisterStartupScripts(Me.Type, [StringScript], True);

}

Below are the comments:

RegisterStartupScripts = (Blue line) - System.Web.UI.Page does not
contain a definition for 'RegisterStartupScripts'.
Me = (Blue Line) - The name 'ME' does not exist in the current context.
[StringScript] = (Redline) - ) expected
True = (Redline) - ; expected


On the HTML Page:

<head runat="server">
<title>Untitled Page</title>

Function OpenWin()
{
var
win=window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no"
window.opener = win;
self.close();
}

window.Onload = OpenWin;
</head>














John said:
In .NET 2.0:

protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScritp(...)
}

John,
Thanks for your quick reply, but now I'm even more lost than before.
This is how I interprit your instructions:

<head runat="server">
<title>Untitled Page</title>

<script language="C#" runat="server">

String scriptString = "function OpenWin() ";
scriptString += "{ ";
scriptString += "var win =
window.open('TSReminder.aspx',null,'height=340,width=640,status=no,toolbar=­no,menubar=no,location=no');
";
scriptString += "window.opener = win; ";
scriptString += "self.close(); ";
scriptString += "} ";
scriptString += "window.onload = OpenWin; ";

</SCRIPT>

</head>

This is just full of red squiggly red lines.

You also say:

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)


I'm assuming that you're refering to add it to:



I also checked Help about Page.RegisterStartupScrips and it says NOTE:
This method is now obsolete. I checked because it also had a red
squggly red line under it.

I'm really hoping that you give me a quick responce like yesterday.

















John Prado wrote:
Dave wrote:
For some reason, the below lines only work on select machines. All
machines are running IE6. IE SP's and OS's vary. When it doesn't
work, default.aspx (the page that this code is in) opens and closes.
That's all you see. TSReminder.aspx doesn't even open. I'm not sure
what's going on here.

Response.Write("<script
language=javascript>window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no")</script>")

Response.Write("<script language=javascript>window.opener =
self</script>")
Response.Write("<script language=javascript>window.close()</script>")

Your code will fit best if you do:

Put the lines below in a string:

---------------------------------
function OpenWin(){ var win =
window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no");
window.opener = win;
self.close();
}

window.onload = OpenWin;
---------------------------------

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)
---------------------------------

I'm not sure if this kind of script is a good practice in developing
web, I thought that is a weird action to user

:eek:pen a browser wndow:shows another one:closes the opener window

Some situations like yours could easily be fired by this piece of mess
up with window pointers.
 
D

Dave

I'm suffering... :-(



John said:
The correct call to RegisterStartupScript in .net 2.0 is:

Page.ClientScript.RegisterStartupScript(...)

Two things
1. I mistyped the end of the function, it has an "S" that not supose to
be at the end of the call.
2. Remove the brackets "[...]" from your call

Dude, take a look at C# sintax. Without know the basics you will suffer
a lot.

Good luck

Thanks Again John for a quick reply. Please keep in mind that I'm
using exactly what you're showing me. If something is in
Brackets...I'm putting Brackets in there as well.


This is what I have:


protected void Page_Load(object sender, EventArgs e)
{
Page.RegisterStartupScripts(Me.Type, [StringScript], True);

}

Below are the comments:

RegisterStartupScripts = (Blue line) - System.Web.UI.Page does not
contain a definition for 'RegisterStartupScripts'.
Me = (Blue Line) - The name 'ME' does not exist in the current context.
[StringScript] = (Redline) - ) expected
True = (Redline) - ; expected


On the HTML Page:

<head runat="server">
<title>Untitled Page</title>

Function OpenWin()
{
var
win=window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no"
window.opener = win;
self.close();
}

window.Onload = OpenWin;
</head>














John said:
In .NET 2.0:

protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScritp(...)
}


Dave wrote:
John,
Thanks for your quick reply, but now I'm even more lost than before.
This is how I interprit your instructions:

<head runat="server">
<title>Untitled Page</title>

<script language="C#" runat="server">

String scriptString = "function OpenWin() ";
scriptString += "{ ";
scriptString += "var win =
window.open('TSReminder.aspx',null,'height=340,width=640,status=no,toolbar=­no,menubar=no,location=no');
";
scriptString += "window.opener = win; ";
scriptString += "self.close(); ";
scriptString += "} ";
scriptString += "window.onload = OpenWin; ";

</SCRIPT>

</head>

This is just full of red squiggly red lines.

You also say:

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)


I'm assuming that you're refering to add it to:




I also checked Help about Page.RegisterStartupScrips and it says NOTE:
This method is now obsolete. I checked because it also had a red
squggly red line under it.

I'm really hoping that you give me a quick responce like yesterday.

















John Prado wrote:
Dave wrote:
For some reason, the below lines only work on select machines. All
machines are running IE6. IE SP's and OS's vary. When it doesn't
work, default.aspx (the page that this code is in) opens and closes.
That's all you see. TSReminder.aspx doesn't even open. I'm not sure
what's going on here.

Response.Write("<script
language=javascript>window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no")</script>")

Response.Write("<script language=javascript>window.opener =
self</script>")
Response.Write("<script language=javascript>window.close()</script>")

Your code will fit best if you do:

Put the lines below in a string:

---------------------------------
function OpenWin(){ var win =
window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no");
window.opener = win;
self.close();
}

window.onload = OpenWin;
---------------------------------

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)
---------------------------------

I'm not sure if this kind of script is a good practice in developing
web, I thought that is a weird action to user

:eek:pen a browser wndow:shows another one:closes the opener window

Some situations like yours could easily be fired by this piece of mess
up with window pointers.
 
D

Dave

I'm suffering... :-(

Thanks for your help all the same.




John said:
The correct call to RegisterStartupScript in .net 2.0 is:

Page.ClientScript.RegisterStartupScript(...)

Two things
1. I mistyped the end of the function, it has an "S" that not supose to
be at the end of the call.
2. Remove the brackets "[...]" from your call

Dude, take a look at C# sintax. Without know the basics you will suffer
a lot.

Good luck

Thanks Again John for a quick reply. Please keep in mind that I'm
using exactly what you're showing me. If something is in
Brackets...I'm putting Brackets in there as well.


This is what I have:


protected void Page_Load(object sender, EventArgs e)
{
Page.RegisterStartupScripts(Me.Type, [StringScript], True);

}

Below are the comments:

RegisterStartupScripts = (Blue line) - System.Web.UI.Page does not
contain a definition for 'RegisterStartupScripts'.
Me = (Blue Line) - The name 'ME' does not exist in the current context.
[StringScript] = (Redline) - ) expected
True = (Redline) - ; expected


On the HTML Page:

<head runat="server">
<title>Untitled Page</title>

Function OpenWin()
{
var
win=window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no"
window.opener = win;
self.close();
}

window.Onload = OpenWin;
</head>














John said:
In .NET 2.0:

protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScritp(...)
}


Dave wrote:
John,
Thanks for your quick reply, but now I'm even more lost than before.
This is how I interprit your instructions:

<head runat="server">
<title>Untitled Page</title>

<script language="C#" runat="server">

String scriptString = "function OpenWin() ";
scriptString += "{ ";
scriptString += "var win =
window.open('TSReminder.aspx',null,'height=340,width=640,status=no,toolbar=­no,menubar=no,location=no');
";
scriptString += "window.opener = win; ";
scriptString += "self.close(); ";
scriptString += "} ";
scriptString += "window.onload = OpenWin; ";

</SCRIPT>

</head>

This is just full of red squiggly red lines.

You also say:

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)


I'm assuming that you're refering to add it to:




I also checked Help about Page.RegisterStartupScrips and it says NOTE:
This method is now obsolete. I checked because it also had a red
squggly red line under it.

I'm really hoping that you give me a quick responce like yesterday.

















John Prado wrote:
Dave wrote:
For some reason, the below lines only work on select machines. All
machines are running IE6. IE SP's and OS's vary. When it doesn't
work, default.aspx (the page that this code is in) opens and closes.
That's all you see. TSReminder.aspx doesn't even open. I'm not sure
what's going on here.

Response.Write("<script
language=javascript>window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no")</script>")

Response.Write("<script language=javascript>window.opener =
self</script>")
Response.Write("<script language=javascript>window.close()</script>")

Your code will fit best if you do:

Put the lines below in a string:

---------------------------------
function OpenWin(){ var win =
window.open("TSReminder.aspx",null,"height=340,width=640,status=no,toolbar=no,menubar=no,location=no");
window.opener = win;
self.close();
}

window.onload = OpenWin;
---------------------------------

In your PageLoad do
---------------------------------
Page.RegisterStartupScritps(Me.Type, [StringScript], True)
---------------------------------

I'm not sure if this kind of script is a good practice in developing
web, I thought that is a weird action to user

:eek:pen a browser wndow:shows another one:closes the opener window

Some situations like yours could easily be fired by this piece of mess
up with window pointers.
 
T

Tasos Vogiatzoglou

What are the security settings of the domain you try to access from the
other computers ? I mean, if the software/equipment is the same, it
must be a configuration issue.

I would check for security related stuff
 
D

Dave

Maybe whether or not JAVA is able to run in IE? All this page is is a
reminder to fill out their Timesheet. The original that they use now
is a Windows Form. It's a pain when you're logging in to the Domain
from somewhere else in the Country/World because that thing has to be
dragged across the wire, so I decided to play with a IE popup. It
loads 10 times faster...when it works.

If it's a settings issue, then what would be a good suggestion so that
we don't have to worry about modifying 30k plus machines to ensure that
it works?
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top