Hi
following code worked for me even without [ValidateInput(false)]
/*------------------------------View---------------------------------*/
<script src="../../Scripts/jquery-1.4.4.js" type="text/javascript"></script>
<script>
function onSubmit() {
debugger;
var data = $("#myform").serialize();
$.ajax({
type: "POST",
url: "http://localhost:49941/Home/SaveData",
data: "data=" + data,
success: function (msg) {
alert("Data Saved: " + msg);
}
});
}
</script>
<form action="SaveData.aspx" method="get" id="myform" onsubmit="return false">
<textarea name="txtAddArActResponsibilty" id="txtAddArActResponsibilty" rows="10">
cols="90"></textarea>
<button value="Submit Data" type="button" onclick="javascript:onSubmit()">
Submit Data
</button>
</form>
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult SaveData()
{
return View();
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult SaveData(string data)
{
return View();
}
$("#myform").serialize();
code will encode all our data so no need to write [ValidateInput(false)]
please modify your code according to the above code