 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 13th, 2004, 09:40 AM
|
|
Authorized User
|
|
Join Date: Sep 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
response.write open link in new window
Im trying to have the link open in a new window can someone please help me.. Thanks,
Code:
If rsArticles ("local") then
Response.Write rsArticles("link_"&strLang)&"_"&strLang&".asp"
else
Response.Write rsArticles("link_"&strLang)
Its in the else that I want to open link_ in new window.
Thanks again.
|
|

October 13th, 2004, 11:32 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Write the whole link in the response.Write, put in the else:
else
Response.Write("<a href=""" & rsArticles("link_" & strLang) & ".asp""" target=""_blank"">")
Brian
|
|

October 13th, 2004, 11:42 AM
|
|
Authorized User
|
|
Join Date: Sep 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
It gives me this error?
Code:
Microsoft VBScript compilation error '800a03ee'
Expected ')'
/incl/articleindex.asp, line 72
Response.Write("<a href=""" & rsArticles("link_" & strLang) & ".asp""" target=""_blank"">")
-----------------------------------------------------------------------^
|
|

October 13th, 2004, 01:03 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Change
".asp""" target
to
".asp"" target
I removed one of the group of three ". There was one too many.
Sorry about that.
Brian
|
|

October 13th, 2004, 01:11 PM
|
|
Authorized User
|
|
Join Date: Sep 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey no problem...
I tried it and this is what shows up as the link:
Code:
Check out all the activities and events planned and learn what you can get involved in (external link). ">More»
In front of the More link also it does open a new window but the link is not taken from the database no more it takes the root main page to show in the browser and this is the URL that shows up in the address bar that gives me a 404 error:
http://cadets-dev.ottawa-hull.mil.ca/ <a%20href=
Please help..
Thanks.
|
|

October 13th, 2004, 02:20 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Try:
Response.Write("<a href=""" & rsArticles("link_" & strLang) & ".asp"" target=""_blank"">More>></a>")
The link wasn't ended.
Brian
|
|

October 21st, 2004, 10:12 PM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have a session variable that I would like to output as a link. I am sure it is a syntax error.
Response.Write ("<a href =""& Session("fname")"">click here</a>")
|
|

October 21st, 2004, 10:34 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Response.Write ("<a href ='" & Session("fname") & "'>click here</a>")
The brackets are optional, you could also:
Response.Write "<a href ='" & Session("fname") & "'>click here</a>"
Are you using a code editor? EG Homesite If not you should probablt start,
the color coding assists you very well in this situation
BTW: Next time start your own post. This way things are catagorized properly assisting others to find solutions (the title of this post does not match your problem/solution)
Wind is your friend
Matt
|
|

October 22nd, 2004, 07:18 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
For you it's the double-quotes that are giving you problems:
Response.Write ("<a href ="""& Session("fname") & """>click here</a>")
Matt's solution is probably better because using single-quotes for attributes makes it easier to read, in my opinion.
Brian
|
|

October 24th, 2004, 06:46 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Yes, using single quotes within the string is much readable. Actually to use double quotes within a string, one has to use 2 double quotes, so that the second negates the special meaning of the first and makes it appear once there.
Code:
Response.write "This is my Quote - ""Live or Let Live"""
The quotes marked in red in the above code makes sure that Live or Let Live appear within double quotes.
This is my Quote - "Live or Let Live"
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|
 |