c# - Asp.net MVC 如何从 Controller 打开新窗口

标签 c# asp.net asp.net-mvc popup actionresult

所以我有一个场景,我想返回我的 ActionResult...Return View("ViewName", "MasterPageName",model);在特定大小的弹出窗口中,我可以通过...

例如:

public ActionResult PopUp()
{
  //do some work...

  //I want this returned in a popup window/modal dialog of some sort...
  return View("ViewName","MasterPageName",model); 
}

从 asp.net mvc 中的 Controller 完成此任务的合理方法是什么?

提前致谢。

最佳答案

在服务器端什么都做不了,但你可以装饰你的 Action 链接

<%= Html.ActionLink("Pop Up", "PopUp", null, new {target="_blank"}) %>

关于c# - Asp.net MVC 如何从 Controller 打开新窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7878062/

相关文章:

html - 在 asp.net mvc 中添加或激活代码 html

asp.net - 如何在 ASP.NET MVC4 Web API 中捕获未定义的 api 方法调用

c# - 从字符串中删除除数字、点 (.) 和逗号 (,) 之外的任何字符

C#数据库检索信息

c# - 获取每个项目的最大值通用列表

c# - WPF 在 EF 的实体值更改时自动绑定(bind)

c# - SiteFinity C# 中的联系表

c# - 是否可以以编程方式在 web.config 中创建位置元素(例如使用 ConfigurationLocation)

c# - 从客户端获取修改后的对象并将其与服务器上的原始对象组合

c# - 在cshtml页面中处理html标签和c#脚本