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 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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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.
...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
| |
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: 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...
|
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,...
|
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...
|
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...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |