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

Datagrid popup window problem

Hi,

I have a datagrid which displays a list of names and a
button next to each name. In the Datagrid_ItemDataBound
event I attach an attribute to each button which sets the
onclick event of each button to a javascript window.open
event that opens up a popup window, the only problem is
that when I push the button, the new window displays but
the other window re_loads itself and after a few seconds
focus is taken away from the new window, back to the
opener, is there any way of stopping this from happening?

Any help with this would be greatly appreciated
Thanks
Stephen
Nov 18 '05 #1
2 1680
Stephen:

Ive done this several times. Sounds like the form is doing a postback when
the window is being opened. You can suppress it by calling return false
after the javascript window.open command. The other option is to use an
HtmlInputButton control, but this has proved to be a PIA for me.

HTH

"Stephen" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
Hi,

I have a datagrid which displays a list of names and a
button next to each name. In the Datagrid_ItemDataBound
event I attach an attribute to each button which sets the
onclick event of each button to a javascript window.open
event that opens up a popup window, the only problem is
that when I push the button, the new window displays but
the other window re_loads itself and after a few seconds
focus is taken away from the new window, back to the
opener, is there any way of stopping this from happening?

Any help with this would be greatly appreciated
Thanks
Stephen

Nov 18 '05 #2
Thank you very much, this now works perfectly! I used the
return false.

-----Original Message-----
Stephen:

Ive done this several times. Sounds like the form is doing a postback whenthe window is being opened. You can suppress it by calling return falseafter the javascript window.open command. The other option is to use anHtmlInputButton control, but this has proved to be a PIA for me.
HTH

"Stephen" <an*******@discussions.microsoft.com> wrote in messagenews:07****************************@phx.gbl...
Hi,

I have a datagrid which displays a list of names and a
button next to each name. In the Datagrid_ItemDataBound
event I attach an attribute to each button which sets the onclick event of each button to a javascript window.open
event that opens up a popup window, the only problem is
that when I push the button, the new window displays but
the other window re_loads itself and after a few seconds
focus is taken away from the new window, back to the
opener, is there any way of stopping this from happening?
Any help with this would be greatly appreciated
Thanks
Stephen

.

Nov 18 '05 #3

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

Similar topics

6
by: Jon | last post by:
Hello, I have a datagrid and the data in it is dynamically created at runtime... For iCounter = 0 To dataset.Tables(0).Columns.Count - 1 Dim objbc As New BoundColumn() With objbc .DataField...
1
by: Joseph Yang | last post by:
Hello all, I have a datagrid bounded with an Arraylist containing contact objects, and a edit button (<asp:imagebutton/>) in each row When I click edit button, I want a window popup so I can...
0
by: vinay | last post by:
In my page I am using a DataGrid with Paging implemented and also have a button seperately on the page, which fires a javascript(Opens a POPUP window) function PrintWin() {...
2
by: Sky | last post by:
Hello: Another question about trying to wring functionality from a DataGrid... Have a DB table of "Contacts" -- 14 or more fields per record Show in datagrid -- but only 5 columns (First,Last,...
0
by: Mike Lowe | last post by:
Having terrible trouble with this. I am using the IBuySpy Portal solution. I have a web control that has a datagrid bound to dataset that is stored in session state. Upon clicking the edit...
1
by: Rob Petersen | last post by:
I have a datagrid with an Edit/Update column. Instead of editing records "in place" I'd like to do so in a separate popup window because there is a lot of validation, business rules and dynamic...
1
by: pv_kannan | last post by:
One of our dev team members is having a strange problem with a datagrid... We are not seeing a datagrid's data getting refreshed after a new row is entered in a popup window inspite of resetting...
0
by: laurent | last post by:
Environment: VS NET 2003 Fr Framework: 1.1 OS: WinXP SP2 Fr Hello I have a problem to add with pop-up and to delete in a datagrid(ButtonColumn delete) on WebForms. code button HTML which...
0
by: TrevorHEK | last post by:
I am using c# and I made a Static DataGrid. I have my own function to set columns and template columns the way I want at runtime. I have been using the same grid class I made for many projects so far...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.