0

I keep getting an error saying "A potentially dangerous Request.Form value was detected from the client". It is because I have html styling tags within the string which I use to display the string within a text area. I need a way to turn off the validation of this item because it keeps displaying the potentially dangerous page. I have found some other sources but I have not had any success yet.

I have tried:

1.) Adding [ValidationInput(false)] at the top of the Action and I was still getting the potentially harmul page.

2.) Adding the <pages validateRequest="false"></pages> and <httpruntime requestValidationMode = "2.0"></httpruntime>in the Web.config but I was gettting a HTTP Error 500.19 - Internal Server Error. With the error on <pages validateRequest="false"></pages>

Is there any way to get past this error?

Here is my model:

public partial class AP_Tasks
    {
        public int TaskID { get; set; }
        public Nullable<System.DateTime> TaskDate { get; set; }
        public string TaskType { get; set; }
        public string AssignedBy { get; set; }
        public string AssignedTo { get; set; }
        public string CC { get; set; }
        public string Whse { get; set; }
        public string PO { get; set; }
        public string FreightNo { get; set; }
        public string VendName { get; set; }
        public Nullable<System.DateTime> ReqCompDate { get; set; }
        public Nullable<System.DateTime> DueDate { get; set; }
        public Nullable<System.DateTime> CompDate { get; set; }

        public string Notes { get; set; }
        public Nullable<System.DateTime> InvDate { get; set; }
        public Nullable<int> CoNo { get; set; }
        public Nullable<int> NoteCnt { get; set; }
    }

I believe that Notes is the issue. It is the string that containes the HTML tags.

5
  • What was the 505 error? Commented Jul 7, 2014 at 17:54
  • Sorry, it was 500.19 error. I changed my post Commented Jul 7, 2014 at 17:57
  • 2
    from the second answer here => What about [AllowHtml] attribute above property? Commented Jul 7, 2014 at 17:59
  • Yep, you just need to add [AllowHtml] to the property. Commented Jul 7, 2014 at 17:59
  • Thank you guys. Can you please make answer to i can mark it? Commented Jul 7, 2014 at 18:03

1 Answer 1

2

Set it on the property level via the [AllowHtml] attribute

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.