Error: A potentially dangerous Request.Form

Khi gặp lỗi: A potentially dangerous Request.Form value was detected from the client

Cách xử lý: thêm thuộc tính vào [ValidateInput(false)] ActionMethod như dưới đây

[HttpPost]
[ValidateAntiForgeryToken]
[ValidateInput(false)]
public ActionResult Edit([Bind(Include = “Id,SubjectId,Title,Content,…”)] Note note)
{

}

A potentially dangerous Request.Form value was detected from the client

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s