Add slashes in Request.Form.

  • Thread starter Thread starter LamSoft
  • Start date Start date
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......
 
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...
 
That's right - Request.Form is read-only...

What are you trying to achieve with this...?
 
The value are going to insert into mySQL Server

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

How can I do this?
 
Back
Top