473,804 Members | 2,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

printing character ' and " in asp using vbscript

S N
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
Mar 16 '08 #1
11 4759
S N
how to print apostrophe character ' and double quote " in asp using
vbscript. my code using response.write replaces " character with question
mark.
please help
Mar 16 '08 #2
'************** *************** *************** *************** *******
Function DataPrep(strTex t)
'
'PURPOSE: prep data text entry
'
'PARAMETERS: strText -- text string to modify
'************** *************** *************** *************** *******
If NOT isNull(strText) then

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

End if

End Function


"S N" <ua******@yahoo .comwrote in message news:OC******** ******@TK2MSFTN GP05.phx.gbl...
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


Mar 16 '08 #3
Jon Paal [MSMD] wrote:
'************** *************** *************** *************** *******
Function DataPrep(strTex t)
'
'PURPOSE: prep data text entry
'
'PARAMETERS: strText -- text string to modify
'************** *************** *************** *************** *******
If NOT isNull(strText) then

DataPrep = Replace(strText , ";", "")
DataPrep = Replace(DataPre p, "'", "&apos;")
DataPrep = Replace(DataPre p, """", "&quot;")
DataPrep = Replace(DataPre p, "<", "&lt;")
DataPrep = Replace(DataPre p, ">", "&gt;")

End if

End Function
??
What's wrong with

Response.Write Server.HTMLEnco de(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"
Mar 16 '08 #4
"Dataprep" type function allows for customization, otherwise nothing wrong with your suggested solution...
Mar 17 '08 #5
Jon Paal [MSMD] wrote on 17 mrt 2008 in
microsoft.publi c.inetserver.as p.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)
Mar 17 '08 #6
where to get the values of constants like &apos and &quot
also i want to replace single " and not double ""

please advise

"Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot comwrote in message
news:13******** *****@corp.supe rnews.com...
'************** *************** *************** *************** *******
Function DataPrep(strTex t)
'
'PURPOSE: prep data text entry
'
'PARAMETERS: strText -- text string to modify
'************** *************** *************** *************** *******
If NOT isNull(strText) then

DataPrep = Replace(strText , ";", "")
DataPrep = Replace(DataPre p, "'", "&apos;")
DataPrep = Replace(DataPre p, """", "&quot;")
DataPrep = Replace(DataPre p, "<", "&lt;")
DataPrep = Replace(DataPre p, ">", "&gt;")

End if

End Function


"S N" <ua******@yahoo .comwrote in message
news:OC******** ******@TK2MSFTN GP05.phx.gbl...
>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



Mar 17 '08 #7
The solutions provided work for others. The problem you have is not an ASP problem per se.

I suspect you will need to look elsewhere in your database/server/browser to find the problem.

I suggest you start debugging by allowing the page to be viewed by someone else with another browser so you can start eliminating
variables.

Narrow down the problem to where it can be isolated and then you may be able to resolve this matter.
Mar 24 '08 #8
S N
which group should i consult. please help

"Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot comwrote in message
news:13******** *****@corp.supe rnews.com...
The solutions provided work for others. The problem you have is not an
ASP problem per se.

I suspect you will need to look elsewhere in your database/server/browser
to find the problem.

I suggest you start debugging by allowing the page to be viewed by someone
else with another browser so you can start eliminating variables.

Narrow down the problem to where it can be isolated and then you may be
able to resolve this matter.

Mar 24 '08 #9
I would start here:

microsoft.publi c.scripting.vbs cript
Mar 24 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
30334
by: Ricardo | last post by:
Hi. How should I pass a " (doble-quote) character to response.write() in order for it to be sent to the output ? Thanks in advance for the help.
3
27040
by: John Davis | last post by:
Since ASP server scripts use VBScript by default, does it mean it is redundant to put the following in ASP page? Then when do we need to use this? In client-side VBScript? <%@ Language="VBScript" %> Thanks! John
6
11800
by: John Davis | last post by:
Just wonder if <%@ Language="JAVASCRIPT" %> exists?? Since JavaScript is used in client-side scripting, but <% ... %> is used in server-side scripting. It sounds doesn't make sense. But I saw that in a ASP test question before. The question is like this: How can you script your ASP code in JavaScript? The answer is: <%@ Language="JAVASCRIPT" %>
1
7539
by: aklsdjfh | last post by:
I'm no expert in asp and vbscript but not a total beginner. I've got some VBScript in an asp page which is generating a forumla for use in Lotus Notes replication. The line that it is objecting to is <% if user2 <> "" then response.write("| @IsMember(&quot;" & LCase(user2) & "&quot;;@LowerCase(@Name(;AssignedTo)))") end if %> i.e. if the string user2 is "Mike" I expect the HTML to be |...
2
12491
by: gerb | last post by:
Hello, I realise this is not a pure Javascript question, and that VBscript is probably involved at some point, though not as much as I fear. If you opened this item looking for a pute Javascript question, I'm sorry. For an IE6 intranet application I'm running into some problems regarding printing screens from the browser. The specs dictate these requirements:
16
48890
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use a commercial program such as Adobe Acrobat and its associated API. The technique uses Ghostscript and Redirection Port Monitor - two free programs for creating PDF documents provided free by Russell Lang. The actual automation requires VBA...
42
9905
by: Prashanth Badabagni | last post by:
Hi, Can any body tell me how to print "hello,world" with out using semicolon Thanks in advance .. Bye Prashanth Badabagni
25
11911
by: mdh | last post by:
I wrote a little insignificant program, to help me write a more significant one!!...that was supposed to print all Ascii values from 0 to 127: >>>> #include <stdio.h> # define UPPER_LIMT 127 int main (){
2
3866
by: Gabriela | last post by:
Hi, I would like to use VBScript regexp to locate multiple characters in a string and replace them with a single "-" char. In my case it's multiple "-" chars: E.g.: "Gabriela---Hello--How----Are-You" -->"Gabriela-Hello-How-Are- You" How is it done? Thanks, Gabi.
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.