Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.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
 
Old April 3rd, 2006, 04:27 AM
Registered User
 
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Gallery Image display in popup Window

Hi

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.
 
Old April 3rd, 2006, 07:50 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Do something like this:

    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."
 
Old April 3rd, 2006, 09:16 AM
Registered User
 
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm programming in C#. I think I get the just of what you're saying though, but if you could would you mind translating that VB into C#?

Bikinis are like Statistics - What they reveal is suggestive but what they conceal is vital.
 
Old April 3rd, 2006, 10:23 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

It is generally a good idea to know both languages then you dont have to ask for the conversion anyway

private void dgItemBound(object sender, DataGridItemEventArgs e)
{
 LinkButton lb;
 if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem) {
   lb = ((LinkButton)(e.Item.Cells([cell lb is located in]).FindControl([lb name])));
   lb.Attributes.Add("onClick", [Javascript to call the popup]);
 }
}

"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display image in a pop-up window nrlahoti ASP.NET 2.0 Professional 1 October 15th, 2007 07:28 AM
Trying to Create Image Gallery jazzcatone ASP.NET 2.0 Basics 0 September 23rd, 2007 04:06 AM
Centering Popup window & Blur Parent window jkusmanto Javascript How-To 0 May 25th, 2007 03:19 AM
Image Gallery Help morpheus Javascript How-To 3 February 20th, 2006 07:45 PM
JavaScript Image Gallery welshboy2005 Javascript How-To 0 May 20th, 2005 04:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.