我的.Net MVC项目中有一个页面,该页面使用javascript调用弹出窗口。现在,我需要将从模型中获得的属性发送到actionresult,以便可以使用它。
我的页面长什么样
<script type="text/javascript">
//function print() {
// $(".btnPrint").printPage();
ShowPopUp = function () {
window.showModalDialog("/FileUpload/GetPopupData/ --Pass my Model property, what to do? --", "wndPopUp", "width=300,height=500");
}
我要在其中使用媒体资源的操作结果
public ActionResult GetPopupData(int consignmentId)
{
var test = consignmentId;
//Call the pop up view and populate it accordingly
return new GetDocumentTypeAction<ActionResult>
{
OnLoaded = m => View("../../Areas/Exports/Views/FileUpload/FileUpload", m),
OnErrorOccured = (m) => Redirects.ToErrorPage()
}.Execute(GtsClient);
}
尝试查询字符串:
"/FileUpload/GetPopupData?consignmentId=" + '@Model.ConsignmentId'
只需确保属性名称与给定操作的方法签名匹配即可。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句