开发者

Unable to enter data into database

开发者 https://www.devze.com 2022-12-28 14:51 出处:网络
I have a gridview, I am allowing user to enter HTML data while editing a record in a gridview row. When I am clicking update button then I am getting this message

I have a gridview, I am allowing user to enter HTML data while editing a record in a gridview row. When I am clicking update button then I am getting this message

A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$gv开发者_如何学GoCommentDetails$ctl02$ctl04="This is message,

This is mark. ...").

Please let me know how could I resolve this , as I am using sql data source to update the gridview record.

=============

" SelectCommand=" SELECT c.Id,c.Name, c.message FROM Table1 c UpdateCommand=" UPDATE Table1 SET Name = @Name, message = @message WHERE Id= @Id">

Thanks in adavance


Basically it means that you can't post values containing HTML ( or script ) tags to the server.

In other words - if you have a textbox and the visitor enters something

This is message, [someHtmlTagGoesHere]

or

This is mark. ...[someTagGoesHere]

and then presses Submit button this error will occur since the posted value(s) contains HTML tags.

To disable request validation on a page add the following directive to the existing "page" directive in the file (you will need to switch to the HTML view for this): ValidateRequest="false"

Hope this helps...

s


Try updating the following in your web.config

<pages validateRequest="false">
0

精彩评论

暂无评论...
验证码 换一张
取 消