chrome的window.returnValue返工

时间:2019-04-04 15:18:18

标签: javascript

我有一个Java日期选择器,它没有传回chrome中的值。我认为这是由于js使用window.returnvalue。我该如何解决?

 // Allow the browser to save/pass the date selected and close the window.
    protected void calDate_SelectionChanged(object sender, System.EventArgs e)
    {
      string closeWindow = @"
                <script language='javascript'>
                    window.returnValue='###date###';
                    window.close();
                </script>";

      closeWindow = closeWindow.Replace("###date###", calDate.SelectedDate.ToShortDateString());

      ClientScript.RegisterStartupScript(this.GetType(), "CloseWindow", closeWindow);
    }

0 个答案:

没有答案