Solved

Apostrophe in VBScript on an ASP page

Posted on 2004-09-01
2
932 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
IP API - need data... 4 30
2012 SQL to JSON Select 5 29
Read text on Table 7 25
Prevent certain words from being typed in a form 6 24
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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

685 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