I am trying to turn off Request Validation for all action methods in a controller by doing this:
[ValidateInput(false)]
public class MyController : Controller
Can you post your controller file and your view file.
This works;
MytestController--------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
namespace testapp.Controllers
{
[ValidateInput(false)]
public class MyTestController : Controller
{
public ActionResult Index()
{
return View();
}
}
}
MyTest(Index)-------------------------------------------------------
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
Index
<% using (Html.BeginForm()) { %>
<%= Html.TextBox("test")%>
<%} %>