Solved

Apostrophe in VBScript on an ASP page

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Group by correlation 4 43
show region if a selection is made on a drop down menu 3 48
Update field in order 21 108
asp syntax 3 25
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

19 Experts available now in Live!

Get 1:1 Help Now