ASP.NET 1.0 and 1.1 BasicsASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I have created a gallery of images that are retrieved from a a database (along with other image information) and bound to a datalist control. I have made the images selectable and now need to display the images as well as the image details. How do I go about displaying the images in a popup window with the image details in the window as well, when the SelectedIndexChange or OnItemCommand event is fired? Also which event do I use? I am using a linkbutton with the text property set to the image URL.
Bikinis are like Statistics - What they reveal is suggestive but what they conceal is vital.
Private Sub dgItemBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles [datagrid].ItemDataBound
Dim lb As LinkButton
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
lb = CType(e.Item.Cells([cell your link button is in]).FindControl([linkbutton name]), LinkButton)
lb.Attributes.Add("onClick", [Client Side Javascript that spawns your popup])
End If
End Sub
For you javascript create a function that takes a string as a parameter for example: popup(url) and in your url do something like this: mypage.aspx?imgid=[imgid] then process the necessary information based upon that id.
"The one language all programmers understand is profanity."