By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,844 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,844 IT Pros & Developers. It's quick & easy.

Opening a Popup windows and refreshing data

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
<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 discussion thread is closed

Replies have been disabled for this discussion.