Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Apostrophe in VBScript on an ASP page

Posted on 2004-09-01
2
Medium Priority
?
941 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

971 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