Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Redirecting and Opening in a New Window
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Redirecting and Opening in a New Window

 Post Reply Post Reply Page  <12
Author
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 16 April 2005 at 1:48pm
Originally posted by dj air dj air wrote:

not sure if its just a formatting error or not but the </script>  has a space.


 
There's actually no space in script. I am not sure why it showed space in the error message above. This was not what I saw in the error message.
 
Mart wrote:
Sorry I meant

Response.Write("<script language=javascript>window.open('PrayerRequests.aspx','mywindow','w idth=400,height=200')</script>")
 
I forgot to let you know that I already have Javascript code in the ASP.Net web page. The code is:
 
 <SCRIPT LANGUAGE=JAVASCRIPT>
 <!--
 
 //---------------------------------------------------------------
 // name: OpenNewWindow(destination)
 //---------------------------------------------------------------
 function OpenNewWindow(destination)
 {  
  //Note: be sure NOT to have spaces before or after the commas in the 'width... part of the
  //open method
 
     newWindow = window.open(destination, 'win1', '')
 }  
 // -->
 </SCRIPT>


Edited by Misty - 16 April 2005 at 2:45pm
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2005 at 1:21pm
I have tried changing the code many times. I am still getting an error message. You can see a copy of my error message below. Can someone please help me with this code? Or maybe you could show me how to modify this code to work with target_blank.
 

Compiler Error Message: BC30648: String constants must end with a double quote.

Source Error:

 

 
Line 313:                 lblResultsTitle.Text = "<h3>Thank you for adding your prayer request! </h3>" 
Line 314:                 
Line 315:                 Response.Write("<script  language=javascript>window.open('PrayerRequests.aspx','mywindow','status=no,toolbar=no,scrollbars =yes,resizable=yes,width=400,height=200,top=0,left=0');</script>")  
Line 316:                 
Line 317:
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2005 at 2:31pm
This should work

Response.Write("<")
Response.Write("script language=javascript>window.open('PrayerRequests.aspx','mywindow','status=no,toolbar=no,scrollbars

=yes,resizable=yes,width=400,height=200,top=0,left=0');</")
Response.Write("script")
Response.Write(">")

the problem is that you are probably using inline code, and you cannot have a <script> or </script> anywhere inside a <script runat="server"> block so you have to replicate it by doing it like that
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2005 at 4:13pm
Originally posted by Mart Mart wrote:

This should work

Response.Write("<")
Response.Write("script language=javascript>window.open('PrayerRequests.aspx','mywindow','status=no,toolbar=no,scrollbars

=yes,resizable=yes,width=400,height=200,top=0,left=0');</")
Response.Write("script")
Response.Write(">")

the problem is that you are probably using inline code, and you cannot have a <script> or </script> anywhere inside a <script runat="server"> block so you have to replicate it by doing it like that
 
Thank you for your help! It finally worked.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.