472,783 Members | 1,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

open new window with one click

Hi all,
I need to set a session variable and open a new window with a single click
of an asp.net button. My problem is that it always takes two clicks.. one
sets the session and the other opens the window... if i write the open window
code in the page load, then the window gets open on 1 click and no session
variable was saved...
any ideas how to get around this...

this is my code:

button click code =

Session("test") = Button46.Text
Button46.Attributes.Add("Onclick", "pickschedule()")

javascript function =

function pickschedule()
{
window.open("newWindow.aspx?", "_blank", "height=500, width=575, left=150,
top=150, " +
"location=no, menubar=no, resizable=no, " +
"scrollbars=no, titlebar=no, toolbar=no", true);
}
thanks!
--
Ad****@hotmail.com
Nov 19 '05 #1
3 2324
I don't know what you are trying to set but maybe you can set it on the new
page you are opening.
Nov 19 '05 #2
Session("test") = Button46.Text
Page.RegisterClientScriptBlock("xyz", "<script
language=""javascript"">pickschedule();</script>")

"ACaunter" <Ad****@hotmail.com> wrote in message
news:BC**********************************@microsof t.com...
Hi all,
I need to set a session variable and open a new window with a single click
of an asp.net button. My problem is that it always takes two clicks.. one
sets the session and the other opens the window... if i write the open window code in the page load, then the window gets open on 1 click and no session
variable was saved...
any ideas how to get around this...

this is my code:

button click code =

Session("test") = Button46.Text
Button46.Attributes.Add("Onclick", "pickschedule()")

javascript function =

function pickschedule()
{
window.open("newWindow.aspx?", "_blank", "height=500, width=575, left=150,
top=150, " +
"location=no, menubar=no, resizable=no, " +
"scrollbars=no, titlebar=no, toolbar=no", true);
}
thanks!
--
Ad****@hotmail.com

Nov 19 '05 #3
Thanks for the replies..
I can't seem to get the code to work right.. the page will just flash
(reload) but no new window will open.. if i put it in the page load , then my
code will work but i just can't get the session var. to save...
the session var. is just the name of the button that clicked to open the
page..
there are many buttons and all open the same page, just sets the labels on
the new page to different text..
can i just open the page in the page load, then from the new window find out
which button was clicked to open this page or somethin...
"David Jessee" wrote:
Session("test") = Button46.Text
Page.RegisterClientScriptBlock("xyz", "<script
language=""javascript"">pickschedule();</script>")

"ACaunter" <Ad****@hotmail.com> wrote in message
news:BC**********************************@microsof t.com...
Hi all,
I need to set a session variable and open a new window with a single click
of an asp.net button. My problem is that it always takes two clicks.. one
sets the session and the other opens the window... if i write the open

window
code in the page load, then the window gets open on 1 click and no session
variable was saved...
any ideas how to get around this...

this is my code:

button click code =

Session("test") = Button46.Text
Button46.Attributes.Add("Onclick", "pickschedule()")

javascript function =

function pickschedule()
{
window.open("newWindow.aspx?", "_blank", "height=500, width=575, left=150,
top=150, " +
"location=no, menubar=no, resizable=no, " +
"scrollbars=no, titlebar=no, toolbar=no", true);
}
thanks!
--
Ad****@hotmail.com


Nov 19 '05 #4

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

Similar topics

2
by: venkatesh | last post by:
Hi Members, I have used the below mentioned code to open a html page in a new browser. The window size is 200 x 300. In that browser, I've given code to open another browser of the same size....
40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
6
by: Shamin | last post by:
Hi, Thanks in advance for answering to my Question. I'm stuck with this problem and would really appreciate any help. I have 2 aspx files (Main.aspx and ReportViewer.aspx). Main.aspx has a...
2
by: carlor | last post by:
Hi there, I have a form that contains a link button. When the user clicks the link button I need to enable a couple of other buttons on the page and open a new browser window giving it focus...
6
by: shil | last post by:
I have a server side button that needs to do some preperation and afterwards, if everything goes well, open a new browser with a specific url. I know how to execute javascript from a server side...
13
by: Geoff Fox | last post by:
I am in the final moments of designing a new website. One of the pages (http://www.auditionfactory.com/samples.php) has four links to show sample work. I would like these links to open new...
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...
1
by: yuenli | last post by:
Hi! I am facing a problem here. I wish to open a sub window from another sub window which means when i click on the main parent window a small window will appear then when i click on the button on...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.