无法在同一页面的MVC中显示模式弹出窗口

时间:2019-07-10 17:14:21

标签: c# .net user-interface razor model-view-controller

我有一个需要显示模态弹出框的要求。当用户单击网格内的链接时,则必须打开带有相应值的模式弹出窗口。但是目前,它会将我带到新页面,而不是在同一页面中将其显示为模式弹出窗口。有人可以看看这个告诉我出了什么问题吗?

这里弹出弹出窗口:

QtySold

控制器:

grid.AddColumn("ProductName", "Product",
             format: (item) =>
             {
                 return Warehouse.Helpers.HtmlHelpers.DialogFormLink2(Html, item.ProductName, @Url.Content("~/Service/ProductCategory/ProductTransactionsPopupView?ProductID=" + @item.ProductID + "&ProgramID=" + Model.ProgramID + "&Status=" + item.ProductStatus + "&ProductRequestID=" + ViewBag.ProductRequestID), null, "Product History", "dialog", "", @Url.Action("ProductProfile"));
             });

模型视图:

 public ActionResult ProductTransactionsPopupView(int ProductID, string ProductStatus, int? ProductRequestID = null)
        {
            var Program = GetProgram();

            var mdl = new ProductTransactionsViewModel { ProgramID = Program.ProgramID, ProductID = ProductID };

            try
            {
                var ProductTransactionResponse = _ServiceProduct.GetProductTransactions(Program.ProgramID, User.Name, ProductID);

                mdl.ProductID = ProductTransactionResponse.ProductId;
                mdl.Transactions = ProductTransactionResponse.ProductTransactions.ToList();
                mdl.ProductName = ProductTransactionResponse.Product != null ? ProductTransactionResponse.Product.ProductName : "";                
                mdl.ProductStatus = ProductStatus;
            }
            catch (Exception ex)
            {
                mdl.ErrorMessage = "An error occured.";
            }

            ViewBag.ProductRequestID = ProductRequestID;

            return View("ProductTransactions", mdl);
        }

0 个答案:

没有答案