Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / May 2006

Tip: Looking for answers? Try searching our database.

Double quote problem in ASP page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Linda Lalewicz - 09 May 2006 22:23 GMT
I need to use VBscript to replace a double quote if found in a string with a
\" in order to make a java popup message work.

I can get it to replace single quotes but cannot form the syntax correctly
for it to do a doublequote replacement without either ignoring the request
entirely, or throwing an error.

How can I modify this statement that works for single quotes, to work for
double quotes???

tempVarBody = Replace(rst("ShortMessage"),"'","\'")

Thanks in advance.
Chineme Nnamdi - 09 May 2006 23:01 GMT
I'm not really clear about what your trying to do but try using

tempVarBody = Replace(rst("ShortMessage"),"\"","\\\"")

Chineme Nnamdi
Linda Lalewicz - 10 May 2006 03:18 GMT
Actually the first parameter in a replace command in VBScript is the string
to be searched, the second parameter is what you are searching for, and the
third is what you want to replace the second parameter with.

So I need a way to tell the replace that I want to replace any double quotes
that are found in the string with a slash then the double quote so that the
java script that I am sending the string to, ignores the double quotes as a
special character, but leaves them in as part of the string.  

So the big problem is making the replace command understand that while
double quotes are what generally delineates the string it has to consider in
parameters 2 & 3, in this case it is in fact a double quote that I am looking
to replace.

> I'm not really clear about what your trying to do but try using
>
> tempVarBody = Replace(rst("ShortMessage"),"\"","\\\"")
>
> Chineme Nnamdi

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.