This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19179|Reply: 2

[ASP.NET] asp.net mvc sets the form post to allow HTML submission

[Copy link]
Posted on 3/8/2018 9:58:22 AM | | |
Asp.net form validation feature is to prevent malicious content such as html, js in http requests.

When the business needs to allow such content to be entered, you can do the following settings:

1. Turn off the validation of the form ([ValidateInput(false)])



2. Set a form attribute separately without validation ([AllowHtml])



3. When using Rquest.Form (Unvalidated)



Also, note that there is a configuration premise in web.config







Previous:Download the image according to the URL address and save it locally
Next:ASP.NET Parameter Pass, Length Limits, and Usage Precautions.
Posted on 3/8/2018 11:06:28 AM |
Take a look
 Landlord| Posted on 3/21/2018 4:27:34 PM |
AllowHtmlAttribute Class


Allows a request to include HTML markup during model binding by skipping request validation for the property. (It is strongly recommended that your application explicitly check all models where you disable request validation in order to prevent script exploits.)
Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com