ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Internal Server Error when inputting the <script> tag to form
Title:
B
I
{code}
?
I input <script> tag to form and submit, it shows "Internal Server Error" without reaching to controller. I also tested on prodinner and see the same error. I appreciate for any help. Thanks!
Save Changes
Cancel
khoadala
asked at 05 Feb 2015
Answers
B
I
{code}
?
it's the asp.net validation, that doesn't allow for script injections, you can disable this validation by adding the [ValidateInput(false)] on the action, you can see it in prodinner in the FeedbackController [HttpPost] [ValidateInput(false)] public ActionResult Create(FeedbackInput input) but if you do that you have to handle the rest yourself, make sure to html encode (if necessary) any values that were entered by the user and through this action you can also use the [AllowHtml] attribute on the viewmodel property that can contain html
Save Changes
Cancel
Omu
answered at 06 Feb 2015
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK