Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to create a movie listing using asp:gridview tag then within the gridview. I use the asp:imagebutton as thumbnail small jpg photo and when click on the image it will open up new windows with bigger new png file. I want to use vb codes behind and change the thumbnail images and big png files programmatically. like a sample code of aspx html page and aspx.vb sample code behind. Any help will be appreciated..
Posted
Comments
karthik Udhayakumar 26-Jan-14 2:24am    
Share your code to help you with!
Member 10533067 26-Jan-14 21:05pm    
I just got this started. Do not have a code yet. Just got some codes from Internet with Gridview display the thumbnails photos using code behind with vb.net. But not able to get the asp:image button to work with hyperlink open up new window with detail of the photo.

1 solution

Here is my default.aspx code
-----------------------------
<asp:gridview id="GridView1" runat="server" xmlns:asp="#unknown">
DataSource='<%# GetData() %>' AutoGenerateColumns="False" AllowPaging="True"
BorderWidth="1px" BackColor="White" CellPadding="3" BorderStyle="None"
BorderColor="#CCCCCC" Font-Names="Arial">
<footerstyle forecolor="#000066" backcolor="White">
<pagerstyle forecolor="#000066" horizontalalign="Left">
BackColor="White">
<headerstyle forecolor="White" font-bold="True">
BackColor="#006699">
<columns> <asp:boundfield headertext="Num" datafield="NumID">
<itemstyle horizontalalign="Center" verticalalign="Middle">


<asp:templatefield headertext="Status" itemstyle-horizontalalign="Center">
<itemtemplate>
<asp:image id="completedImage" runat="server" imageurl="<% # completedImage() %>" alternatetext="">



<asp:boundfield headertext="Title" datafield="Title" sortexpression="Title">
<asp:boundfield headertext="Date Added" datafield="DateAdded" dataformatstring="{0:d}"> <itemstyle horizontalalign="Center">

<asp:boundfield headertext="ISO File" datafield="ISOFile">
<itemstyle horizontalalign="Center">

<asp:boundfield headertext="Mobile" datafield="MBFile">
<itemstyle horizontalalign="Center">

<asp:boundfield headertext="HD File" datafield="HDFile">
<itemstyle horizontalalign="Center">

<asp:imagefield headertext="Picture" dataimageurlfield="PictureURL">
ControlStyle-Height="150" ControlStyle-Width="105"
alternatetext="Movie Photo"
NullDisplayText="No image on file." readonly="true">
<controlstyle height="150px" width="105px">

<selectedrowstyle forecolor="White" font-bold="True" backcolor="#669999">
<rowstyle forecolor="#000066">




Here is the default.aspx.vb codes:
--------------------------------------

Public Function completedImage() As String
completedImage = "\myFiles\KidPhoto.jpg"
result = "\images\yellow.gif"
Return result
End Function


I am unable to define and access to change the jpg photo and gif photo in code behind.
The gif photo show up fine but does not allow me to click photo and bring up the bigger jpg photo. Please help..
 
Share this answer
 
Comments
Member 10533067 5-Feb-14 23:21pm    
Above is my examples of code and is not the solutions. Please any help to correct about codes will be appreciated..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900