Trouble with popup windows

G

Guest

I am building an ASP.NET application where I have been required to make all
the editing screens popup windows within the application. I didn't have any
trouble creating the new windows but only about half of them show on top of
the main application when they are created. The window are created in
javascript and I've tried using the top property of the window object but it
still does not work for all my windows and all the windows are created using
the same command. Am I missing something in javascript or is this an issue
with the new Internet Explorer?

This is the code I used to create my popup windows:

'Create a script to bring up the update window
strScript = "<script language='javascript'>"
strScript &=
"window.open('frmServiceLogUpdate.aspx?mode=update&servicelogid=" &
CInt(TableRow_LogID.Value) & "&clientid=" & Session("ServiceClientID") &
"','AddLog','width=522,height=450,top=100,left=200,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');window.top(0);"
strScript &= "</script>"

'Execute the script
RegisterClientScriptBlock("NewEntry", strScript)

Any help would be greatly appreciated.
 
B

bruce barker

couple of issues.

1) your generating pop's with inline script will not work with popup
blockers (ie xp-sp2).
2) if the popup window already exists, window open will not bring it to the
front, you need to set focus to the window
3) if the popup window has been minimized, you need to close and reopen the
window.

-- bruce (sql;work.com).



| I am building an ASP.NET application where I have been required to make
all
| the editing screens popup windows within the application. I didn't have
any
| trouble creating the new windows but only about half of them show on top
of
| the main application when they are created. The window are created in
| javascript and I've tried using the top property of the window object but
it
| still does not work for all my windows and all the windows are created
using
| the same command. Am I missing something in javascript or is this an
issue
| with the new Internet Explorer?
|
| This is the code I used to create my popup windows:
|
| 'Create a script to bring up the update window
| strScript = "<script language='javascript'>"
| strScript &=
| "window.open('frmServiceLogUpdate.aspx?mode=update&servicelogid=" &
| CInt(TableRow_LogID.Value) & "&clientid=" & Session("ServiceClientID") &
|
"','AddLog','width=522,height=450,top=100,left=200,directories=no,location=n
o,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');window.top(0)
;"
| strScript &= "</script>"
|
| 'Execute the script
| RegisterClientScriptBlock("NewEntry", strScript)
|
| Any help would be greatly appreciated.
 
G

Guest

Thank you for your quick response but I am still having some difficulties.
In response to your sugesstions I already had the popup blocker turned off,
the popup windows are only created when a user clicks a button and are closed
after use, and the window can not be resized. I tried using the focus method
on the window but still with no luck. For example on one page a user can
open a window to add a new entry to a table or they can open a window to edit
an existing entry. If I click the button to edit the entry, no problems the
window opens on top of the application. If I click the button to add an
entry, the new window opens but it is created underneath the application.
Both windows open the same asp.net page and the only difference in the code
are the parameters each one passs. I am very confused.

Chris
 
G

Guest

Just curious.. Is smartnav enabled in your web.config? I have noticed this
problem when smartnav is enabled.
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top