Thanks, and I'm sure this is a stupid question but....how do I keep the popup window on top. It shows for a second and then hides behind main page.
Main Topics
Browse All TopicsCreating a web site using Visual Web Developer 2005 Express (Asp.Net 2.0) using VB.
I have a page that uses Java PopUp windows:
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,lo
And then calll the popup with:
<a href="javascript:popUp('..
<span style="font-size: 16pt"><strong>?</strong></
Now I would like to call a popup for the same page within VB code:
Protected Sub NewButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If CheckBox3.Checked = False And CheckBox4.Checked = False Then
'call popup
End If
Can I do this?
Thanks in advance for your help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>>I'm sure this is a stupid question but
Not at all!
With javascript "window.open"....you can't always force it to stay on top....you can try modifying your script so that it does try to keep the popup modal....but you might still get inconsistent results with different browsers....
http://javascript.about.co
A different route is to use something like:
http://www.asp.net/AJAX/Aj
The problem is that as soon as a user clicks on the buttom in the main page that opens the popup window, the popup window flashes on top for just a split second and then the popup window is immediately minimized. I understand that it is difficult to keep the popup window on top when users click elsewhere, but that is not my concern. I just need the popup to stay on top when it is initially opened.
I think (as you indicated) that I need "window.open" in the VB code that you provided, but I don't know where. Sorry, but my limited background is only in Flash and VB5.
I'm not seeing the behavior you describe (pop up immediately goes to the back)...
I'm using this test page with 3 different variations of "window.open" behind a button....
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm
<script runat="server">
Protected Sub NewButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If Me.CheckBox3.Checked Then
If Not Page.ClientScript.IsStartu
Page.ClientScript.Register
End If
End If
End Sub
Protected Sub ButtonDiffScript_Click(ByV
If Me.CheckBox3.Checked Then
If Not Page.ClientScript.IsStartu
Page.ClientScript.Register
End If
End If
End Sub
Protected Sub ButtonOldScript_Click(ByVa
If Me.CheckBox3.Checked Then
If Not Page.ClientScript.IsStartu
Page.ClientScript.Register
End If
End If
End Sub
</script>
<html xmlns="http://www.w3.org/1
<head runat="server">
<title>Untitled Page</title>
<script language="javascript">
day = new Date();
id = day.getTime();
function popUp(URL) {
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,lo
function modalWin(URL) {
if (window.showModalDialog) {
window.showModalDialog(URL
"dialogWidth:500px;dialogH
} else {
window.open(URL,id,
'toolbar=0,scrollbars=0,lo
}
}
function standardPop(URL) {
window.open(URL,id,'toolba
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CheckBox ID="CheckBox3" runat="server" />
<br />
<br />
<asp:Button ID="NewButton" runat="server"
Text="Modal JS" OnClick="NewButton_Click" />
<br />
<br />
<asp:Button ID="ButtonDiffScript" runat="server" Text="Not using Eval" OnClick="ButtonDiffScript_
<br />
<asp:Button ID="ButtonOldScript" runat="server" Text="Original Script" OnClick="ButtonOldScript_C
</form>
</body>
</html>
Business Accounts
Answer for Membership
by: samtran0331Posted on 2007-10-29 at 08:43:54ID: 20170428
Protected Sub NewButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) pScriptReg istered("M yScript") Then StartupScr ipt(Me.Get Type, "MyScript", "<script type=""text/javascript"">p opUp('../p opup.htm') ;</script> ")
If CheckBox3.Checked = False And CheckBox4.Checked = False Then
If Not Page.ClientScript.IsStartu
Page.ClientScript.Register
End If
End If