473,466 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HtmlEncode? Other Alternative?

Hey guys. I'm working a large project that has dozens of forms to collect
user input. A lot of the fields are text and capture long text from the
user. It writes to MS SQL 2000.

I've built a simple "replace" function to replace and encode harmful
characters on the server side such as single quotes, commas and so on.
Problem is that when a user submits a < or a > char, the server barks and
sees it as harmful. For example:

A potentially dangerous Request.Form value was detected from the client
(txtDescription="My expenses are > my revenues").

It's likely that the user will use these two chars. I thought about looking
into HTMLEncode but this is processed on the server. So how should I handle
this? Should I use HTMLEncode? How do the guru's do it?

Thanks!

(asp.net 2 /vb)



Jun 29 '06 #1
2 1933
Check the following article -

http://www.asp.net/faq/RequestValidation.aspx?tabid=1

Groove wrote:
Hey guys. I'm working a large project that has dozens of forms to collect
user input. A lot of the fields are text and capture long text from the
user. It writes to MS SQL 2000.

I've built a simple "replace" function to replace and encode harmful
characters on the server side such as single quotes, commas and so on.
Problem is that when a user submits a < or a > char, the server barks and
sees it as harmful. For example:

A potentially dangerous Request.Form value was detected from the client
(txtDescription="My expenses are > my revenues").

It's likely that the user will use these two chars. I thought about looking
into HTMLEncode but this is processed on the server. So how should I handle
this? Should I use HTMLEncode? How do the guru's do it?

Thanks!

(asp.net 2 /vb)


Jun 29 '06 #2
Excellent. Thanks!

--

<bh************@gmail.com> wrote in message
news:11**********************@y41g2000cwy.googlegr oups.com...
Check the following article -

http://www.asp.net/faq/RequestValidation.aspx?tabid=1

Groove wrote:
Hey guys. I'm working a large project that has dozens of forms to
collect
user input. A lot of the fields are text and capture long text from the
user. It writes to MS SQL 2000.

I've built a simple "replace" function to replace and encode harmful
characters on the server side such as single quotes, commas and so on.
Problem is that when a user submits a < or a > char, the server barks and
sees it as harmful. For example:

A potentially dangerous Request.Form value was detected from the client
(txtDescription="My expenses are > my revenues").

It's likely that the user will use these two chars. I thought about
looking
into HTMLEncode but this is processed on the server. So how should I
handle
this? Should I use HTMLEncode? How do the guru's do it?

Thanks!

(asp.net 2 /vb)

Jun 29 '06 #3

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

Similar topics

4
by: abcd | last post by:
Simple but not working at this moment I have to fill the HTML select control.... my values could be for example "test number 1" sample code, dim x Data = "test ...
4
by: Anders Both | last post by:
Hello dotnet.aspnet group - I want to do encode e.g. japanise or arabic text into something like: بةكوردي عةلي Before putting it in my HTML code (aspx page) . But when i try to use ...
3
by: Michael Gaillez | last post by:
Hi, I'm dynamically loading an assembly into an ASP.NET application. In the control that I load from that dynamic assembly I've tried to use Server.HTMLEncode but this results in a serious...
4
by: Andy Fish | last post by:
When using databinding, I have gotten into the habit of using single quotes (apostrophe) round attribute values rather than double quotes because this allows visual studio to work when there are...
3
by: David Lozzi | last post by:
Howdy, I have my left navigation of Hyperlinks, and part of the link's querystring is the title of the page they are going to. For example, one of the pages is Cars & Trucks. With HtmlEncode, it...
0
by: \A_Michigan_User\ | last post by:
I guess I'm not understanding this correctly. I have to set "ValidateRequest=False" for my asp.net 1.1 page that has a TextBox... so that I can avoid an error... if some user enters some html or...
1
by: Marco Miltenburg | last post by:
While working on some multilingual code I found a rather strange thing happening with Server.HTMLEncode. While loading different languages I change the Codepage and Charset in ASP to reflect the...
1
by: Alexander Higgins | last post by:
>>Thanks for the response.... Point Taken but this is not the case. Thus, if a person writes a text file on her or his computer and does not use UNICODE to save it, the current code page is...
7
by: jaja | last post by:
Hello all, I am familiar with the HtmlEncode Server method. I also read this : http://msdn2.microsoft.com/en-us/library/a2a4yykt(VS.80).aspx My question is: If I want to encode all inputs from...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.