Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does XP SP2 think my webform is a pop-up? Is it bcos toolbar=no?

Status
Not open for further replies.

mb224

Programmer
Oct 15, 2004
55
0
0
US
I open another window (webform) from my main window. I suppress the toolbar and menubars for this second window. However my XP users seem to have problem .. thinking it is a pop-up window? Why? Is it because I suppress the tool-bar and menubar. It is still a webform ... not a pop-up!!!! Or am I wrong?

The form looks better with the toolbar and menu bars suppresed so I's rather have it like that... Is there a way for me to get around this without having to inform all XP users to enable pop-up blockers?

Here is how I open the second form using server-side code ...


Dim strClientCall As String
strClientCall = "<script language=javascript> "
strClientCall &= " window.open(" & "'webfrmMy.aspx?z=0" & "','frmMy','toolbar=no,menubar=no,left=225,width=490,height=625'" & ")"
strClientCall &= "</script>"

Response.Write(strClientCall)
 
It is a pop-up because the user didn't request it to be opened - it was your web form that told it to open by using window.open and therefore it is a pop-up.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
It is generally considered rude to open a window without a user explicit request.

__________________________________________
Try forum1391 for lively discussions
 
Hmmm .... I had a command button on the main form ... and when the user clicked the coomand button (cmdAdd) .. the code was executed ... here is the full code for the click event ..... I could not use Response.Write("webfrmMy.aspx") bcos it will then replace my main form instead of opening another window ... is there another way to open the second form with the toolbar and menu bar suppressed when the user clicks the cmdAdd button, so that it is not a pop-up?

Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddPolicy.Click
Dim strClientCall As String
strClientCall = "<script language=javascript> "
strClientCall &= "var winAdd= window.open(" & "'webfrmMy.aspx?z=0" & "','frmMy','toolbar=no,menubar=no,left=225,width=490,height=625'" & ")"
strClientCall &= "winAdd.focus();"
strClientCall &= "</script>"

Response.Write(strClientCall)

End Sub
 
what if you put this on the onclick event client side? not sure if it'd still think it's a popup...

on page load
Code:
Dim strClientCall As String
strClientCall = "window.open('webfrmMy.aspx?z=0" & "','frmMy','toolbar=no,menubar=no,left=225,width=490,height=625'" & "); winAdd.focus();"
cmdAdd.attributes.add("onclick",strClientCall)
 
i'll try it and let you know ... sounds like worth trying
 
Now I'm having trouble getting the second window to open. I'm still trying all forms of the syntax assuming that is the problem!!!
 
What's wrong with the code that checkai provided? It works without any modifications.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Outside from aggressive pop-up blocking, the above JavaScript should work fine. How exactly is it behaving for you?

If you could get the desired interface with an anchor tag, you could easily use its target="_blank" attribute for a similar effect.

________________________________________
Andrew

I work for a gift card company!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top