我在javascript中創建圖像並將其分配給javascript中的img元素。如何將該圖像傳遞給ActionButton上的控制器在MVC3中單擊?MVC3將圖像傳遞給控制器
的Javascript
var picture = jqplotToImg($('#ChartContent')); //method to change chart as picture, no needed here
var img = document.getElementById("img1");
img.src = picture;
查看
@using (Html.BeginForm())
{
<img id="img1" name="img1" />
@Html.ActionButton("Export","ExportData","Report")
}
控制器
public void ExportReport(FormCollection fc)
{
}
發佈您的代碼... –
你想發佈圖像文件到控制器還是什麼? img標籤不是輸入標籤,所以它不通過表格發佈 –
是的,我想發佈圖像作爲文件。確切的需要是我想添加圖像到Excel中。但圖像是從客戶端創建的。所以想到先將映像發佈到服務器上,然後將其添加到excel中。 – DON