Take the 2-minute tour ×

I am using FCKEditor on my page.

and i want to save its content on database..but on doing this error A potentially dangerous Request.Form value was detected from the client (LongDescriptionVal="<p>hello..</p>"). occur on my page..

what i am doing is here:-


protected void btnadd_Click(object sender, EventArgs e)

    string _detail = Request["LongDescriptionVal"].ToString();
    string query = "insert into Description(description) values('" + _detail.Trim() + "')";
    SqlCommand cmd = new SqlCommand(query, con);

and aspx:-

<strong>Full Description :</strong>
                <br />
                            <!--Editor Code comes here  -->

                            <script type="text/javascript">
                                var oFCKeditor = new FCKeditor( 'LongDescriptionVal') ;
                                oFCKeditor.BasePath = 'fckeditor/';
                                oFCKeditor.Height   = 300;
                                oFCKeditor.Value    = '<%=FullDescription%>';
                                oFCKeditor.Create() ;
                  <br />
                  <asp:Button ID="btnadd" runat="server" Text="Add" OnClick="btnadd_Click" />

anyone can tell me that how can i save data on database...

Thanks in advance..

share|improve this question
Thanks to all.. now it is running.... –  divya Jun 2 '11 at 10:51

3 Answers 3

up vote 1 down vote accepted

add validateRequest="false" into your page;


<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" ValidateRequest="false" Inherits="MyApp.Default" %>
share|improve this answer
Thanks.. now it is running.... –  divya Jun 2 '11 at 10:50

Have a look at this question: A potentially dangerous Request.Form value was detected from the client

The gist of the answer is that you can suppress the warning by setting validateRequest="false" in the <@Page directive of your aspx file.

There is a reason for that warning however, by doing so you could in your case open yourself up to all sorts of attacks. Given the nature of your database access code can I suggest that you read up on using Parameterized Queries

share|improve this answer

in aspx page, set the property ValidateRequest="False", but don't forget to encode input before saving in database.

share|improve this answer

Your Answer


