Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Window.Open / Window.Close question

Reply
Thread Tools

Window.Open / Window.Close question

 
 
Dave
Guest
Posts: n/a
 
      07-11-2006
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,me nubar=no,location=no")</script>")

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

 
Reply With Quote
 
 
 
 
John Prado
Guest
Posts: n/a
 
      07-11-2006
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,me nubar=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,wid th=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

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.
 
Reply With Quote
 
 
 
 
Dave
Guest
Posts: n/a
 
      07-12-2006
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,wid th=640,status=no,toolbar=*no,menubar=no,location=n o');
";
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:

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 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,me nubar=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,wid th=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
>
> 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.


 
Reply With Quote
 
Tasos Vogiatzoglou
Guest
Posts: n/a
 
      07-12-2006
Have you checked for popup blockers ?

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,me nubar=no,location=no")</script>")
>
> Response.Write("<script language=javascript>window.opener =
> self</script>")
> Response.Write("<script language=javascript>window.close()</script>")


 
Reply With Quote
 
Dave
Guest
Posts: n/a
 
      07-12-2006
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.




Tasos Vogiatzoglou wrote:
> Have you checked for popup blockers ?
>
> 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,me nubar=no,location=no")</script>")
> >
> > Response.Write("<script language=javascript>window.opener =
> > self</script>")
> > Response.Write("<script language=javascript>window.close()</script>")


 
Reply With Quote
 
John Prado
Guest
Posts: n/a
 
      07-12-2006
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,wid th=640,status=no,toolbar=*no,menubar=no,location=n o');
> ";
> 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,me nubar=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,wid th=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
>>
>> 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.

>

 
Reply With Quote
 
Dave
Guest
Posts: n/a
 
      07-12-2006
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,locatio n=no"
window.opener = win;
self.close();
}

window.Onload = OpenWin;
</head>














John Prado wrote:
> 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,wid th=640,status=no,toolbar=*no,menubar=no,location=n o');
> > ";
> > 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,me nubar=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,wid th=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
> >>
> >> 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.

> >


 
Reply With Quote
 
John Prado
Guest
Posts: n/a
 
      07-12-2006
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


Dave wrote:
> 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,locatio n=no"
> window.opener = win;
> self.close();
> }
>
> window.Onload = OpenWin;
> </head>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> John Prado wrote:
>> 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,wid th=640,status=no,toolbar=*no,menubar=no,location=n o');
>>> ";
>>> 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,me nubar=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,wid th=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
>>>>
>>>> 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.

>

 
Reply With Quote
 
Dave
Guest
Posts: n/a
 
      07-12-2006
I'm suffering...



John Prado wrote:
> 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
>
>
> Dave wrote:
> > 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,locatio n=no"
> > window.opener = win;
> > self.close();
> > }
> >
> > window.Onload = OpenWin;
> > </head>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > John Prado wrote:
> >> 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,wid th=640,status=no,toolbar=*no,menubar=no,location=n o');
> >>> ";
> >>> 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,me nubar=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,wid th=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
> >>>>
> >>>> 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.

> >


 
Reply With Quote
 
Dave
Guest
Posts: n/a
 
      07-12-2006
I'm suffering...

Thanks for your help all the same.




John Prado wrote:
> 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
>
>
> Dave wrote:
> > 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,locatio n=no"
> > window.opener = win;
> > self.close();
> > }
> >
> > window.Onload = OpenWin;
> > </head>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > John Prado wrote:
> >> 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,wid th=640,status=no,toolbar=*no,menubar=no,location=n o');
> >>> ";
> >>> 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,me nubar=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,wid th=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
> >>>>
> >>>> 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.

> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question row filter (more of sql query question) =?Utf-8?B?YW5kcmV3MDA3?= ASP .Net 2 10-06-2005 01:07 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM



Advertisments