pop window appearing behind main window

O

Ollie

I have a popup window displayed when the user clicks on a button in an
asp.net. It uses the following code to display the popup window.

System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script language='javascript'>");
sb.Append("faq = window.open('");
sb.Append(Request.ApplicationPath);
sb.Append("/FAQ/FAQ.aspx?FAQ="+"Analysis");
sb.Append("','FAQ','menubar=no, toolbar=no, scrollbars=no, resizable=yes,
status=yes, width=480, height=660, left=50, top=50');");
sb.Append("faq.focus();");
sb.Append("</script>");
Page.RegisterStartupScript("FAQ", sb.ToString());

The problem is that the popup window appears behind the main window, how can
I make it appear in front?

I am using IE 6....


Cheers in advance

Ollie
 
G

Guest

You should put the the focus method inside the new window. (The focus method on a page can only refer to the elements on the same page

I.e
in FAQ.aspx

<html><head></head><body onload="window.focus();"></body></html

----- Ollie wrote: ----

I have a popup window displayed when the user clicks on a button in a
asp.net. It uses the following code to display the popup window

System.Text.StringBuilder sb = new System.Text.StringBuilder()
sb.Append("<script language='javascript'>")
sb.Append("faq = window.open('")
sb.Append(Request.ApplicationPath)
sb.Append("/FAQ/FAQ.aspx?FAQ="+"Analysis")
sb.Append("','FAQ','menubar=no, toolbar=no, scrollbars=no, resizable=yes
status=yes, width=480, height=660, left=50, top=50');")
sb.Append("faq.focus();")
sb.Append("</script>")
Page.RegisterStartupScript("FAQ", sb.ToString())

The problem is that the popup window appears behind the main window, how ca
I make it appear in front

I am using IE 6...


Cheers in advanc

Olli
 

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

Top