473,378 Members | 1,412 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,378 software developers and data experts.

launching window in frame with a button control

Hi,

I am using the following code to try to open a window in a target
frame using a button control that is in the original frame. It does
not work unless I click the button twice. If anyone can help I'd
appreciate it. This is on a standard webform.

.......................................
Private Sub btTools_Click(ByVal sender As System.Object, ByVal e_ As
System.EventArgs) Handles btTools.Click

btTools.Attributes.Add("onClick", "window.open('reps.aspx', 'main' )")

End Sub
........................................

Thanks,
Dave
Nov 17 '05 #1
1 1666
Dave wrote:
Hi,

I am using the following code to try to open a window in a target
frame using a button control that is in the original frame. It does
not work unless I click the button twice. If anyone can help I'd
appreciate it. This is on a standard webform.

......................................
Private Sub btTools_Click(ByVal sender As System.Object, ByVal e_ As
System.EventArgs) Handles btTools.Click

btTools.Attributes.Add("onClick", "window.open('reps.aspx', 'main' )")

End Sub
.......................................

Thanks,
Dave

You should place the code in the "Page_Load" but not btTools_Click.

Your code just will set the client side "onClick" AFTER your click the
button. Hence, before first click on the button, teh client side
"onClick" has nothing.

--
Jacky Kwok
ja***@alumni.cuhk.edu.hk
ja***@compose.com.hk

Nov 17 '05 #2

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

Similar topics

6
by: Clara | last post by:
Hi,... I meant to write an application where there is a button in a window and when you click on the button, it will open a new window, but I want the first window to close, replaced by the second...
10
by: Scott | last post by:
I'm new to ASP, but I've been programming in VB for several years, and I'm having a few issues with this ASP enhancement I'm working on. I've found ASP to be a lot different than what I'm use to...
1
by: Hrvoje Vrbanc | last post by:
Hello all, here is what I'd like to do: I have an ASPX page with certain buttons that opens in its window, naturally. When any of those buttons is clicked, I'd like the action to happen in...
1
by: Dave | last post by:
Hi, I am using the following code to try to open a window in a target frame using a button control that is in the original frame. It does not work unless I click the button twice. If anyone...
1
by: axiarich | last post by:
We have some doc mgt "lite" on our site. I basically have a window with a button that opens the relevant document (Excel, PDF, etc.). The button calls some javascript which basically performs a...
1
by: Grant | last post by:
Hi, I am looking for a tip. I have a panel and a checkbox. When I check the checkbox, I would like to add buttons to the panel (dynamically). When the checkbox is unchecked, the buttons should...
10
by: Simon Verona | last post by:
I've decided to store my help pages on a web site rather than deliver with my application (trying to reduce the size of the install files). The web site is sort of all ready to rock and roll. ...
7
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed...
1
by: Garg | last post by:
Hi, I am facing a problem while trying to close a window that I've opened in a frame. I am using javascript to close my current popup window. I have written the following line of code on click...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.