ASP.Net javascript "focus" method needs to be called twice??

G

getmyemails2

Hello,

I am using the script below to open a new window and once opened,
redirect to that open window from the original window:

private void btnNewPDFWindow_Click(object sender, System.EventArgs e)

{

string NewPage = "NewPageZoom.aspx";

string ScriptBlockNewPage = "<script language='javascript'>var
NewPDFPage=window.open('" + NewPage + "','PDFPage');";

ScriptBlockNewPage = ScriptBlockNewPage +
"NewPDFPage.focus();</script>";

Response.Write(ScriptBlockNewPage);

}
For some reason, with the code above, I have to click the button twice
in order to get it to focus to the 2nd window again.
Any ideas?

Regards,

TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top