Click below for Step by Step and Interview Q & A (dotnetinter) wrote,
Click below for Step by Step and Interview Q & A
dotnetinter

ASP.NET MVC 4 interview questions : - What is the use of “AllowHTML” and “ValidateInput” attributes?

We would like thank www.questpond.com for their continuous support to provide us these interview questions on a daily basis.

While working with MVC you may have noticed that MVC actions doesn’t allow posting HTML values. This is done to avoid cross site scripting security issues.Look at the following example where we are trying to post HTML to the MVC action.While working with MVC you may have noticed that MVC actions doesn’t allow posting HTML values. This is done to avoid cross site scripting security issues.Look at the following example where we are trying to post HTML to the MVC action.

server


But you can bypass this restriction by using one of the following 2 attributes

1) ValidateInput attribute at controller level or action level
    server2
2) AllowHtml attribute at Mode Level
    server3


You can also read 50 extensive ASP.NET MVC Interview questions with answers from this codeproject article.
Tags: asp.net mvc question for beginners, information technology questions, mvc 4 validateinput attribute interview , mvc allowhtml interview questions, mvc interview questions with answers
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments