ASP.NET - How to check if open new window if opened correctly or it is blank

Asked By bhanupratap singh on 19-Oct-16 07:41 AM
Hi,
How to check if open new window if opened correctly or it is blank.

 string Fullurlhttp = "http://www." + url ;+"/Pagename.html";

 OpenNewBrowserWindow(Fullurlhttp, this);

public static void OpenNewBrowserWindow(string Url, Control control)
    {
        ScriptManager.RegisterStartupScript(control, control.GetType(), "Open", "window.open('" + Url + "');", true);
    }

if page name is correct then it works, if page name is not correct then it open blank.
I want to check if open window has opened blank page.
Robbe Morris replied to bhanupratap singh on 19-Oct-16 08:47 AM
you can get a reference to the opened window by doing this:

You could declare a global variable:

var _myWindow;

function OpenMyWindow(url)
{
  _myWindow = window.Open(blah blah blah);
}

From there you can inspect the document object model of the _myWindow open for whatever you want.