Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

printing character ' and " in asp using vbscript
how to print apostrophe character ' and double quote " in asp using
vbscript.
my code using response.write replaces " character with inverted question
mark.
please help



Report this thread to moderator Post Follow-up to this message
Old Post
S N
03-16-08 11:59 PM


Re: printing character ' and " in asp using vbscript
how to print apostrophe character ' and double quote " in asp using
vbscript.  my code using response.write replaces " character with question
mark.
please help



Report this thread to moderator Post Follow-up to this message
Old Post
S N
03-16-08 11:59 PM


Re: printing character ' and " in asp using vbscript
how to print apostrophe character ' and double quote " in asp using
vbscript.  my code using response.write replaces " character with inverted
question  mark.
please help



Report this thread to moderator Post Follow-up to this message
Old Post
S N
03-16-08 11:59 PM


Re: printing character ' and " in asp using vbscript
'***************************************
***************************
Function DataPrep(strText)
'
'PURPOSE:   prep data text entry
'
'PARAMETERS:  strText -- text string to modify
 '***************************************
***************************
If NOT isNull(strText) then

DataPrep = Replace(strText, ";", "")
DataPrep = Replace(DataPrep, "'", "'")
DataPrep = Replace(DataPrep, """", """)
DataPrep = Replace(DataPrep, "<", "&lt;")
DataPrep = Replace(DataPrep, ">", "&gt;")

End if

End Function




"S N" <uandme72@yahoo.com> wrote in message news:OCmJVc5hIHA.4076@TK2MSFTNGP05.phx.gbl...[c
olor=darkred]
> how to print apostrophe character ' and double quote " in asp using vbscri
pt.
> my code using response.write replaces " character with inverted question m
ark.
> please help
>
>[/color]



Report this thread to moderator Post Follow-up to this message
Old Post
Jon Paal [MSMD]
03-16-08 11:59 PM


Re: printing character ' and " in asp using vbscript
Jon Paal [MSMD] wrote:
>  '***************************************
***************************
> Function DataPrep(strText)
> '
> 'PURPOSE:   prep data text entry
> '
> 'PARAMETERS:  strText -- text string to modify
>  '***************************************
***************************
> If NOT isNull(strText) then
>
> DataPrep = Replace(strText, ";", "")
> DataPrep = Replace(DataPrep, "'", "'")
> DataPrep = Replace(DataPrep, """", """)
> DataPrep = Replace(DataPrep, "<", "&lt;")
> DataPrep = Replace(DataPrep, ">", "&gt;")
>
> End if
>
> End Function
>
??
What's wrong with

Response.Write Server.HTMLEncode(strText)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
03-16-08 11:59 PM


Re: printing character ' and " in asp using vbscript
"Dataprep" type function allows for customization, otherwise nothing wrong w
ith your suggested solution...



Report this thread to moderator Post Follow-up to this message
Old Post
Jon Paal [MSMD]
03-17-08 08:57 AM


Re: printing character ' and " in asp using vbscript
Jon Paal [MSMD] wrote on 17 mrt 2008 in
microsoft.public.inetserver.asp.general:

> "Dataprep" type function allows for customization, otherwise nothing
> wrong with your suggested solution...

whose?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Report this thread to moderator Post Follow-up to this message
Old Post
Evertjan.
03-17-08 12:59 PM


Re: printing character ' and " in asp using vbscript
where to get the values of constants like &apos and "
also i want to replace single " and not double ""

please advise

"Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot com> wrote in message
news:13tqv4u4qegn7c8@corp.supernews.com...
>  '***************************************
***************************
> Function DataPrep(strText)
> '
> 'PURPOSE:   prep data text entry
> '
> 'PARAMETERS:  strText -- text string to modify
>  '***************************************
***************************
> If NOT isNull(strText) then
>
> DataPrep = Replace(strText, ";", "")
> DataPrep = Replace(DataPrep, "'", "'")
> DataPrep = Replace(DataPrep, """", """)
> DataPrep = Replace(DataPrep, "<", "&lt;")
> DataPrep = Replace(DataPrep, ">", "&gt;")
>
> End if
>
> End Function
>
>
>
>
> "S N" <uandme72@yahoo.com> wrote in message
> news:OCmJVc5hIHA.4076@TK2MSFTNGP05.phx.gbl... 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
msnews
03-17-08 12:59 PM


Re: printing character ' and " in asp using vbscript
' and " are HTML entities - these are converted by web browsers
into ' and " respectively.

If you just want to print the literal characters, that's easy enough:

Response.Write """"

will print a single " (there are 4 " in that line, the two outer ones are
the string containers, the two inners generate the single " as doubling them
up inside a string turns them into a literal instead).

another example

Response.Write "<a href=""http://myurl.com/apage.asp"">This is a link</a>"

Notice how you just double up the quotation marks.

For an apostrophe you don't need to do anything special:

Response.Write "They're not here"

So what problem are you having with quotes and apostrophes?


Dan

msnews wrote  on Mon, 17 Mar 2008 15:05:23 +0530:

> where to get the values of constants like &apos and " also i want
> to replace single " and not double ""

> please advise

> "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot com> wrote in
> message  news:13tqv4u4qegn7c8@corp.supernews.com... 
 
 
 



 







Report this thread to moderator Post Follow-up to this message
Old Post
Daniel Crichton
03-17-08 12:59 PM


Re: printing character ' and " in asp using vbscript
Daniel Crichton wrote:
> ' and " are HTML entities - these are converted by web
> browsers into ' and " respectively.
>
> If you just want to print the literal characters, that's easy enough:
>
> Response.Write """"
>
> will print a single " (there are 4 " in that line, the two outer ones
> are the string containers, the two inners generate the single " as
> doubling them up inside a string turns them into a literal instead).
>
> another example
>
> Response.Write "<a href=""http://myurl.com/apage.asp"">This is a
> link</a>"
> Notice how you just double up the quotation marks.
>
> For an apostrophe you don't need to do anything special:
>
> Response.Write "They're not here"
>
> So what problem are you having with quotes and apostrophes?
>

From the original post: "my code using response.write replaces " character
with question
mark"

It's most likely a codepage problem. I've been holding back from replying to
this because Anthony typically has the most reliable advice for these
situations.



--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
03-17-08 12:59 PM


Sponsored Links




Last Thread Next Thread Next
Pages (4): [1] 2 3 4 »
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:15 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.