Related Tags:
Asp.Net It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. Learn More, C# C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. Learn More, ASP.NET MVC The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc assembly. Learn More, MVC 4 It is a newer version of ASP.NET MVC,ASP.NET MVC 4 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of ASP.NET and the .NET Framework. Learn More,

'A potentially dangerous Request.Form value was detected from the client' error in asp.net mvc 4?

Description:Getting the following error in my mvc 4 application after deployment 'A potentially dangerous Request.Form value was detected from the client' on inserting html through my input boxes, i want to allow the html to be inserted.

Posted by: | Posted on: Jan 02, 2018

1 answers

Replies

2

To avoid this error you can use following ways
-add [ValidateInput(false)] attribute on the the controller 's method as shown

[ValidateInput(false)]
public ActionResult Edit(MyModel item)
{
// ...
}

-Or you can add [AllowHtml] attribute on your model's property as shown.

[AllowHtml]
public string MyDescription { get; set; }

Replied by: | Replied on: Jan 04, 2018



Reply
×

Code block Hyperlink bold Quotes block Upload Images

Preview