Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Need help with an imagebuttonNeed help with an imagebutton
Previous
 
Next
New Post
3/25/2008 9:54 AM
 

Hello,
I am trying to create thumbnails with a datalist.  I have the urls of each image stored in a database (images are on a seperate server).  I have the URL binded to the imageurl of the imagebutton and I added itemcommand code that will redirect to original image.  For some reason it does not work.  I was able to get it to work with a linkbutton and when I try to do it with a hyperlink it does not maintain the height and width (the images appears as the original size) set.  

Here's the asp code:
<asp:datalist id="dlPics" runat="server" RepeatDirection="Horizontal" RepeatColumns="10" OnItemCommand="ViewPhotos">
<ItemTemplate>
<asp:ImageButton id=ibtnPics runat="server" Width="75px" Height="50px" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "AllPhotos") %>' ToolTip="Click to Enlarge" CommandName="item">
</asp:ImageButton>
</ItemTemplate>
</asp:datalist>


Here's the code behind.

Protected Sub ViewPhotos(ByVal sender As Object, ByVal e As DataListCommandEventArgs)
       Dim imgINDPhotos As ImageButton = CType(e.Item.FindControl("ibtnPics"), ImageButton)
       Dim photoUrl As String = imgINDPhotos.ImageUrl.ToString '  = CType(e.Item.FindControl("ibtnPhotos"), ImageButton).ImageUrl
       Response.Redirect(photoUrl)
   End Sub

Any help is greatly appreciated.

Thanks

John



 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Need help with an imagebuttonNeed help with an imagebutton


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out