How do you dynamically build <a href> in a reponse.write statement

J

Jack

Hi,
I have the following piece of code:If RS.EOF or RS.BOF Then
Session("Authenticated") = False

Response.Write "Sorry, your userid or password did not match"
Response.Write "<BR>"
Response.Write " or you have not registerd yet, please register"
Response.Write <a href="default.asp">Clik here
Response.End
Here, I need to build the line (Response.Write <a href="default.asp">Clik
here)
dynamically, so that the html output from asp page
gives us <a href="default.asp">Clik here
Thanks for any help or advise in advance
 
T

Tom Kaminski [MVP]

Jack said:
Hi,
I have the following piece of code:If RS.EOF or RS.BOF Then
Session("Authenticated") = False

Response.Write "Sorry, your userid or password did not match"
Response.Write "<BR>"
Response.Write " or you have not registerd yet, please register"
Response.Write <a href="default.asp">Clik here
Response.EndResponse.Write <a href="default.asp">Clik here
Here, I need to build the line (Response.Write <a href="default.asp">Clik
here)
dynamically, so that the html output from asp page
gives us <a href="default.asp">Clik here
Thanks for any help or advise in advance

Response.Write "<a href='default.asp'>Clik here
or
Response.Write "<a href=""default.asp"">Clik here
 
J

Jack

Thanks Ben, that was exactly I was looking for. I did not express myself
well, I guess. Regards
 
J

Jack

Hello Tom,
I was wondering what is the concept behind both the staetment being correct.
Thanks. Regards
 
T

Tom Kaminski [MVP]

Jack said:
Hello Tom,
I was wondering what is the concept behind both the staetment being
correct.

The concept is the browser will accept a quote or a double quote.
 
R

Ray Costanzo [MVP]

If you're in favor of following X-HTML standards and the standards that are
most likely to be adopted as time moves on, you should use " instead of '
for your tag attributes. In today's world, it really doesn't matter for
functionality's sake, but " is or will be the accepted strict standard, most
likely.

Ray at work
 
P

Paxton

Jack said:
Hi,
I have the following piece of code:If RS.EOF or RS.BOF Then
Session("Authenticated") = False

Response.Write "Sorry, your userid or password did not match"
Response.Write "<BR>"
Response.Write " or you have not registerd yet, please register"
Response.Write <a href="default.asp">Clik here
Response.End
Here, I need to build the line (Response.Write <a
href="default.asp">Clik
here)
dynamically, so that the html output from asp page
gives us <a href="default.asp">Clik here
Thanks for any help or advise in advance

Double up on your double quotes: response.write "<a
href=""default,asp"">lick here</a>"

P
 

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,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top