.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 24th, 2003, 02:40 PM
bvandyke bvandyke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 bvandyke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry asp.net -String constants must end with a double quote - problem

I am putting an inline javascript tag to open a new window when pressing an asp:button control. I got this from another forum (they want to charge to post). Here is the code:

code
------------------------------------------------------------------------
response.write("<script language='JavaScript'>window.open('sources.asp','PopUp','location=no,too lbar=no,status=no,menubar=no,scrollbars=yes,resiza ble=yes')</script>")

------------------------------------------------------------------------
I am getting the "string constant must end with a double quote" compliter error on the last ")" before the </script> tag.

On further digging the actual error is:

Statement cannot appear within a method body. End of method assumed

Talking about the ")". For some reason it is trying to end the command prior to the </script> tag instead of after it.

Any ideas?

Thanks

Reply With Quote
  #2  
Old September 24th, 2003, 03:06 PM
iahmed iahmed is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: USA
Posts: 171 iahmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 58 sec
Reputation Power: 16
Try Following:

<a href="javascript:window.open('source.asp','Reference','r esizable=yes, toolbar=no,location=no,directories=no, status=no, menubar=no, scrollbars=yes,width=600,height=400');void('');">Click here for reference</a>

Reply With Quote
  #3  
Old September 25th, 2003, 08:33 AM
bvandyke bvandyke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 bvandyke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
double quote probelm

Well, I don't thing that using the <a href> tag will work. I need to open the page from a button click event, not a link on the page. It needs to do some other processing before opening the page.

Thanks

Reply With Quote
  #4  
Old September 26th, 2003, 12:40 PM
numbernine numbernine is offline
Up To His Eyes In Ads
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Chicago
Posts: 160 numbernine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 17
I just copied your code and ran it without any problem...

Reply With Quote
  #5  
Old September 27th, 2003, 03:58 AM
bvandyke bvandyke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 bvandyke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
double quote problem

Now that is really strange. the code is a direct copy and paste from my code.

Did it run in a browser and open a new window?

Brett

Reply With Quote
  #6  
Old September 27th, 2003, 04:04 AM
bvandyke bvandyke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 bvandyke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
double quote

numbernine - what version of the .net framwork are you running? Mine is 1.1

Reply With Quote
  #7  
Old September 30th, 2003, 10:51 AM
numbernine numbernine is offline
Up To His Eyes In Ads
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Chicago
Posts: 160 numbernine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 17
I'm using version 1.0.3705.288

Reply With Quote
  #8  
Old September 30th, 2003, 11:18 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to dhouston
Maybe it's choking on the parentheses? Try escaping the js parentheses using \ and see if that'll serve as a workaround. Just a shot in the dark...

Reply With Quote
  #9  
Old October 2nd, 2003, 01:03 PM
mikejoseph mikejoseph is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 1 mikejoseph User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile

Try this instead:

response.write("<script language='JavaScript'>window.open('sources. asp','PopUp','location=no,toolbar=no,status=no,men
ubar=no,scrollbars=yes,resizable=yes')<" & "/script>")

I guess there's a bug in the in-line parser that thinks the </script> tag in a string is actually the end of the script. Just break up the string to have it work. Obviously you can make the above line more efficient w/ a String.Format or String.Concat, but that's the jist of it.

Hope this helps.

Mike

Reply With Quote
  #10  
Old October 2nd, 2003, 10:29 PM
bvandyke bvandyke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 bvandyke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
parsing

Thanks!!!!

Reply With Quote
  #11  
Old April 8th, 2004, 10:15 AM
msnegur msnegur is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 msnegur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I had the same problem. Thanks, mikejoseph, it worked like a charm.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > asp.net -String constants must end with a double quote - problem


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap