0

Validation was not occurring Asp.net MVC2, I am using ckeditor Control that why mentioned "[ValidateInput(false)]"

Controller

[AcceptVerbs(HttpVerbs.Post)]
[ValidateInput(false)] 
public ActionResult Create(EventInfo EventInfo)
{
    //
}

Model

[Required(ErrorMessage = "Title is required")]
[StringLength(250, ErrorMessage = "Maximum 250 Characters")] 
public string TITLE { get; set; }

How can i solve this issue.

2
  • Please be more specific. Commented Sep 21, 2011 at 17:54
  • Validation is not occuring. I mentioned the required field also, i'm ckeditor for paragraph text thatswhy i mentioned validateinput = false otherwise ckeditor will not work. but validation also not working give me the solution Commented Sep 23, 2011 at 20:32

1 Answer 1

2

You're probably asking for

if (!ModelState.IsValid)
    return View(EventInfo);
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.