Add slashes in Request.Form.

L

LamSoft

How to add slashes for the each element in the incoming Request.Form

I tried:
for (int i = 0; i < Request.Form.Count; i++)
{
Request.Form. = Request.Form.Replace("'",
"\\'").Replace("\"", "\\\"");
}

But it causes an error and showing Request.Form is an read-only
attributes......
 
P

Patrice

You can't change the incoming HTTP request. Your best bet would be likely to
make this change where those values are consumed. You may want to explain
what you are trying to do...
 
M

Mark Rae [MVP]

That's right - Request.Form is read-only...

What are you trying to achieve with this...?
 
L

LamSoft

The value are going to insert into mySQL Server

So it needs to be escaped......

How can I do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top