如果有人能提供建議,我將不勝感激。我有2個視圖(不是部分),我希望一次返回空白頁(target = "_blank"
)。 我提交形式如下:通過一個ActionResult在空白頁面中返回多個視圖
@using (Html.BeginForm("Action1", "Controller1", new { target = "_blank"})
{
//model data
<input type="submit" value = "Go" id="btn"/>
}
在我的控制器我有2個ActionResults:
public ActionResult Action1(MyModel model)
{
return View(model);
}
public ActionResult Action2(string year)
{
ViewBag.year = year;
return View();
}
所以我想打電話給兩個Action1 and Action2
。 Action1
接受該模型作爲參數,並且Action2
接受可以從MyModel
獲取的一些字符串。 有沒有辦法做到這一點? 我試圖通過jquery調用Action2
提交按鈕單擊,但它將無法正常工作,因爲我想在新標籤中顯示視圖。
在此先感謝!
有關報告。我有一個ReportViewer(aspx頁面),其中包含顯示所有數據的rdlc報告以及另一個包含報告標題(類型標題)的aspx頁面。 –
我會建議你爲該創建部分視圖 – Satpal
謝謝,但他們應該分開。 –