2013-10-24 19 views

回答

1

你可以簡單地傳遞的HTML數據到控制器

使用ValidateInput屬性跳過HTML /腳本驗證請求中

[HttpPost, ValidateInput(false)] 
public ActionResult Store(string html) 
{ 

} 

在jQuery中的Ajax

$.post('/Controller/Store/', {html:tble}, function(data){ 

}); 
+0

一個問題:var request = $ .ajax({../reports/Sendrt",//action方法url在controller中定義的 type:'POST ', cache:false, data:JSON.stringify(tble), dataType:'json', contentType:'application/json; charset = utf-8' }); – Pankaj

+0

@ user2408936,我不明白你的意思。你可以在你自己的問題中格式化這個代碼,這樣其他人就可以理解了 –