Solved

Apostrophe in VBScript on an ASP page

Posted on 2004-09-01
2
927 Views
Last Modified: 2012-08-14
I have an apostrophe problem showing up on an ASP page. The apostrophe acts like a delimiter and I tried just about everything. I'm using a Response.Write statement like this...

Response.Write(CHR(13) & "<td class='resultsrow" & intRow & "'><INPUT type=checkbox name='clipboard" & intClipBoardNumber & "' value='http://" & sLink & "/documents/" & sRadarFileNumber & "     " & sValue & "'></td>")

The problem is when sValue has an apostrophe in it. I tried to replace the apostrophe with douple apostrophes and this doesn't work because of the apostrophe after "value=".
0
Comment
Question by:wseaward
2 Comments
 
LVL 4

Expert Comment

by:MrClean21
ID: 11952986
Hi wseaward,

Use Server.URLEncode(sValue)

MrClean
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 125 total points
ID: 11958909
A different approach is to use the quotation mark as the delimiter. However, you need to double them up, so if you want name="strFirstName" you would write instead name=""strFirstName""

Here it is with your string:

Response.Write(CHR(13) & "<td class=""resultsrow" & intRow & """><INPUT type=checkbox name=""clipboard" & intClipBoardNumber & """ value=""http://" & sLink & "/documents/" & sRadarFileNumber & "     " & sValue & """></td>")


FtB
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now