如何从javascript打开新窗口并从中获取价值

时间:2012-02-13 15:25:29

标签: javascript asp.net asp.net-mvc

我在MVC3视图中有一个Image,在其单击处理程序中,我使用以下方法调用一个action方法:

    $.ajax({
    type: "POST",
    url: action,
    success: function (result) {
      //do Stuff
    }
    });

我想

  • 检查服务器上的内容,然后
  • 打开一个新窗口,
  • 当用户关闭该窗口时,父级会使用新窗口中的值进行更新。

我有点不知道这是否可能,任何人都知道如何做到这一点?

1 个答案:

答案 0 :(得分:0)

你的意思是:

(HttpContext.Current.Handler as System.Web.UI.Page).ClientScript.RegisterStartupScript(
            this.GetType(),
            "winPop",
            "window.open(\"html/???.htm\", \"popup\", \"width=480, height=400\");",
            true);