Friday, August 26, 2011

How to solve "A potentially dangerous Request.Form value was detected from the client" in ASP.NET MVC 3

#1: Add AllowHtml Attribute into property in the model
#2: Turn off validation on the Action:
        public ActionResult Index(string htmlsource)
            var x = htmlsource;
            return View();

Following link is about to solve same problem in ASP.NET webform

How to click a button by Javascript in Webforms?

Two ways:
1. By jQuery:

2. By __doPostBack function
__doPostBack('server side id name', 'Click');