473,320 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

window.open question

I'm running the below script to open a popup window. Works great!
I'd like to find out if there's a way to include Mouse Coordinates in
the top and left parameters so that when my button is clicked, the
popup opens in the same location.
protected void btnLocateEmpID_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
sb.Append("<script>");
sb.Append("window.open('LocateEmpID.aspx', '','toolbar=0,
height=320,width=375,resizable=0,scrollbars=0');") ;
sb.Append("</scri");
sb.Append("pt>");
Page.RegisterStartupScript("test", sb.ToString());
}

Please be as descriptive as possible with your reply.

Thanks for your help! ;-)

Nov 10 '07 #1
3 3727
http://msdn2.microsoft.com/en-us/library/ms536651.aspx
--
http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Dave" wrote:
I'm running the below script to open a popup window. Works great!
I'd like to find out if there's a way to include Mouse Coordinates in
the top and left parameters so that when my button is clicked, the
popup opens in the same location.
protected void btnLocateEmpID_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
sb.Append("<script>");
sb.Append("window.open('LocateEmpID.aspx', '','toolbar=0,
height=320,width=375,resizable=0,scrollbars=0');") ;
sb.Append("</scri");
sb.Append("pt>");
Page.RegisterStartupScript("test", sb.ToString());
}

Please be as descriptive as possible with your reply.

Thanks for your help! ;-)

Nov 10 '07 #2
Peter, that link basically tells me what I already have in my original
posting. Thank you all the same. My Original Posting says that the
script I had worked Great. My original question...How Can I get
"Mouse Coordinates" (X,Y) to include them as Left and Top parameters
so that the popup window opens "where the button was clicked"? That
link doesn't provide that.

On Nov 10, 10:56 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
http://msdn2.microsoft.com/en-us/library/ms536651.aspx
--http://www.eggheadcafe.com
unBlog:http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Dave" wrote:
I'm running the below script to open a popup window. Works great!
I'd like to find out if there's a way to include Mouse Coordinates in
the top and left parameters so that when my button is clicked, the
popup opens in the same location.
protected void btnLocateEmpID_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
sb.Append("<script>");
sb.Append("window.open('LocateEmpID.aspx', '','toolbar=0,
height=320,width=375,resizable=0,scrollbars=0');") ;
sb.Append("</scri");
sb.Append("pt>");
Page.RegisterStartupScript("test", sb.ToString());
}
Please be as descriptive as possible with your reply.
Thanks for your help! ;-)- Hide quoted text -

- Show quoted text -

Nov 10 '07 #3
Dave wrote:
Peter, that link basically tells me what I already have in my original
posting. Thank you all the same. My Original Posting says that the
script I had worked Great. My original question...How Can I get
"Mouse Coordinates" (X,Y) to include them as Left and Top parameters
so that the popup window opens "where the button was clicked"? That
link doesn't provide that.
It's kind of messy in implementation on a per-browser basis.

Scroll down until you see the Mouse Position heading.
http://www.quirksmode.org/js/events_properties.html
Chris.
Nov 12 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Les | last post by:
Hi, I'd like to find out how to use the window.open() script in Fireworks MX. I have posted my question in the Fireworks forum but didn't get any replies. Since it's javascript, maybe someone...
4
by: Dan Cruz | last post by:
Below are two files: Main.asp and Help.asp. I've stripped it down to the 'barest-of bones' so that anyone willing to help can duplicate the problem on their own systems. ***Main.asp*** looks...
2
by: Richard Bell | last post by:
I'm a bit new to Javascript and am trying to do oNewWin = window.open( ... ); then determine when the contents of oNewWin are completely loaded. I've tried oNewWin.attachEvent( "onload",...
8
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var...
4
by: Fowler | last post by:
1.) i want to open a browser when click a button the browser can only be open ONE only, no TWO can be open!
13
by: Seth Grimes | last post by:
Hello all, I want to open a window when a user leaves my site. I set up a function called by onUnload. To skip the window.open if the user hasn't left my site, I set a variable in my links and...
4
by: NC | last post by:
Hi All, We have an issue where if we say: window.open(uri, 'QuickTradePopup', 'width=730,height=300,menubar=no,toolbar=no,scrollbars=yes,resizable=yes').
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
4
by: arajunk | last post by:
In Firefox this opens a full size window (maximized) . In IE it opens the partial window requiring user to click restore (upper right) to maximize. What am I missing ? var...
0
by: Dave | last post by:
I'm running the below script to open a popup window. Works great! How Can I get "Mouse Coordinates" (X,Y) to include them as Left and Top parameters so that the popup window opens "where the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.