var tble = "<html><table><tr><td>212121</td></tr></table></html>";
我已經把它存儲到某些文件在我的硬盤發送這個數據到控制器,並加載它形成我的硬盤和發送給我的控制器。如何自動pertculer loacation使用javascript上傳文件MVC4(讀/寫)操作
var tble = "<html><table><tr><td>212121</td></tr></table></html>";
我已經把它存儲到某些文件在我的硬盤發送這個數據到控制器,並加載它形成我的硬盤和發送給我的控制器。如何自動pertculer loacation使用javascript上傳文件MVC4(讀/寫)操作
你可以簡單地傳遞的HTML數據到控制器
使用ValidateInput
屬性跳過HTML /腳本驗證請求中
[HttpPost, ValidateInput(false)]
public ActionResult Store(string html)
{
}
在jQuery中的Ajax
$.post('/Controller/Store/', {html:tble}, function(data){
});
一個問題: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
@ user2408936,我不明白你的意思。你可以在你自己的問題中格式化這個代碼,這樣其他人就可以理解了 –
爲什麼你需要存儲在本地文件中並再次讀取?如果你想發送數據,你可以簡單地檢查我的代碼 –