473,499 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening a Popup windows and refreshing data

Hello I have a datagrid and a linkbuttom in the datagrid that says Picture,
every time I click on the link "Picture" my program opens a popup window
showing a picture of the item the selected and information about the item.
On the html of the datagrid I have the following:
OnItemCommand="Grid_CartCommand" OnItemCreated="DataGrid_ItemCreated".

My VB functions are the following:
Sub DataGrid_ItemCreated(ByVal Sender As Object, ByVal e As
DataGridItemEventArgs)

Select Case e.Item.ItemType

Case ListItemType.Item, ListItemType.AlternatingItem

Dim myDeleteButton As LinkButton

myDeleteButton = e.Item.FindControl("PictureButton")

myDeleteButton.Attributes.Add("onclick",
"window.open('popup.aspx',null,'height=350, width=300,status= no, resizable=
no,scrollbars=no, toolbar=no,location=no,menubar=no ');")

End Select

Exit Sub

Sub Grid_CartCommand(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)

Select Case e.CommandSource.CommandName

Case "Picture"

Session("item") = Trim(e.Item.Cells(2).Text)

End Select

On the page_load of the popup.aspx I have
txtitemnumber.Text = Session("item")

And all the code for loading a picture that belongs to the item in
txtitemnumber.Text

The thing is every time I click on the Picture link, it opens my popup.aspx
and executes the page_load and after that it executes the Grid_CartCommand
function. It means that always I bring the data related to the previous item
selected, not the last item selected. I need to execute the CartCommand
function before and then open the popup window, this way I'll show the
information related to the item selected. Or I need a way of refreshing the
popup windows page after it's load and do this without having to press a
bottom because then it would mean that the user has to press a bottom for
refreshing which it's not helpful.

Please give me some ideas.

Thanks in advance

Jennyfer
Nov 19 '05 #1
1 2011
<script language="c#" runat="server">
myDeleteButton.Attributes.Add("onclick",
"picWin = window.open('popup.aspx','picWin','height=350, width=300,status=
no, resizable=
no,scrollbars=no, toolbar=no,location=no,menubar=no ');")
</Script>

naming the window ('picWin') will solve your problem.

--Daniel Fisher(lennybacon)
myDeleteButton.Attributes.Add("onclick",
"window.open('popup.aspx',null,'height=350, width=300,status= no,
resizable=
no,scrollbars=no, toolbar=no,location=no,menubar=no ');")

"Jennyfer J Barco" <pd*****@nospam.wdsinc.com> wrote in message
news:eJ**************@TK2MSFTNGP14.phx.gbl... Hello I have a datagrid and a linkbuttom in the datagrid that says
Picture,
every time I click on the link "Picture" my program opens a popup window
showing a picture of the item the selected and information about the item.
On the html of the datagrid I have the following:
OnItemCommand="Grid_CartCommand" OnItemCreated="DataGrid_ItemCreated".

My VB functions are the following:
Sub DataGrid_ItemCreated(ByVal Sender As Object, ByVal e As
DataGridItemEventArgs)

Select Case e.Item.ItemType

Case ListItemType.Item, ListItemType.AlternatingItem

Dim myDeleteButton As LinkButton

myDeleteButton = e.Item.FindControl("PictureButton")

myDeleteButton.Attributes.Add("onclick",
"window.open('popup.aspx',null,'height=350, width=300,status= no,
resizable=
no,scrollbars=no, toolbar=no,location=no,menubar=no ');")

End Select

Exit Sub

Sub Grid_CartCommand(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)

Select Case e.CommandSource.CommandName

Case "Picture"

Session("item") = Trim(e.Item.Cells(2).Text)

End Select

On the page_load of the popup.aspx I have
txtitemnumber.Text = Session("item")

And all the code for loading a picture that belongs to the item in
txtitemnumber.Text

The thing is every time I click on the Picture link, it opens my
popup.aspx
and executes the page_load and after that it executes the Grid_CartCommand
function. It means that always I bring the data related to the previous
item
selected, not the last item selected. I need to execute the CartCommand
function before and then open the popup window, this way I'll show the
information related to the item selected. Or I need a way of refreshing
the
popup windows page after it's load and do this without having to press a
bottom because then it would mean that the user has to press a bottom for
refreshing which it's not helpful.

Please give me some ideas.

Thanks in advance

Jennyfer

Nov 19 '05 #2

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

Similar topics

4
8917
by: Jamie Jackson | last post by:
The crux of the problem is I only know if the popup *has been* opened, but not if it *is* open. Therefore, the script doesn't know whether to simply refocus, or whether to popup a fresh window. ...
1
2146
by: sentinel | last post by:
Hello, I'm having problems refreshing a main window, and am not sure really whether the solution will be Javascript or PHP related. Firstly, I have a main file that calls a pop-up box which...
6
2013
by: Logger | last post by:
Help, Want someone's option. I'm calling a popup screen, say form B, to add/edit a record. In, say form A, I call form B using javascript window.open in server side code. I need to know when I...
14
11016
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
0
1387
by: Jack Addington | last post by:
I have a 'quickadd' type window for doing quick data entry. The window is launch from a MDI child and is suppose to be a re-sizable popup/child window. This is an excel type datagrid for doing...
2
1182
by: Konrad R. | last post by:
Hi all i have 3 popup windows, in which i can add, edit and delete records from a table, now after user is done, i want to refresh main window, i am using...
2
2069
by: Matt Hamilton | last post by:
I have an application page with a datagrid with a checkbox on each row. The user should check the rows they want to modify and then click a button. When the button is clicked, I have a Click...
3
5833
by: evanburen | last post by:
I use this code in a popup to refresh the parent browser. It works fine as long as the user actually clicks on this link but does not work in cases where the user closes the child popup through the...
1
1451
by: paintedjazz | last post by:
I am using the following javascript to make a popup menu allow the user to navigate to different pages on a website. Yet it is opening windows as if I have <base target="some-name"> defined in the...
0
7007
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
7174
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
7220
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...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.