Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 June 8th, 2008, 06:04 AM
Authorized User
 
Join Date: Jun 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem on image click

hi everyone..



i do have pasted my code in this post.. i am retrieving some data from the database and viewing it in the grid view. i do retrieve an image/pic along with the other data in the same grid view ...when the user clicks on this image , it should transfer the user to some other page and this image should be displayed over there.. for example, if you goto eurocalling card site, when you click on the card (image/pic) it will take you to another pop-up window , with the card details... in my project i have to do like that....can u help me out to sort this issue plz...waiting for your reply... (plz help me out in VB code)..i do have stored the image in the database as filename.



<asp:DataList

ID="DataList1"

Forecolor="white"

AutoGenerateColumns="False"

EnableViewState="False"

CellPadding="10"

Runat="Server" style="z-index: 112; left: -46px; position: absolute; top: 24px" Height="290px" Width="189px">







<HeaderTemplate>

<table border=1 cellpadding=4>

<tr bgcolor="#eeeeee">

<th width="200">image</th>

<th width="100">card name</th>

<th width="200">Calling from</th>

<th width="200">Calling to </th>

<th width="200">Price</th>



<th width="200">Quantity</th>

<th width="200">Details</th>

<th width="200">Add to Basket</th>

</tr>
</HeaderTemplate>

<ItemTemplate>

<tr>
<td><img src="<%#DataBinder.Eval(Container.DataItem,"pictur e1")%>" width="90" Height="90"

onclick="image_click" ></img></td>
<td><%#DataBinder.Eval(Container, "DataItem.cardname")%></td>

<td><%#DataBinder.Eval(Container, "DataItem.country")%></td>
<td><%#DataBinder.Eval(Container, "DataItem.destination")%></td>

<td><%#DataBinder.Eval(Container, "DataItem.price1")%></td>
<td> 1 </td>

<td><%#DataBinder.Eval(Container, "DataItem.details1")%></td>
<td><asp:Button ID="Button2" Text="Add to Cart" runat="server"

OnCommand="AddToCart"

CommandName='<%# Container.DataItem("picture1")%>'/>



</td>
</tr>



</ItemTemplate>

<FooterTemplate>

</table>

</FooterTemplate>



</asp:Datalist>



Sub image_click(ByVal Src As Object, ByVal Args As CommandEventArgs)
PassedValues.Text = Args.CommandName

Response.Redirect("description.aspx?picture1" & PassedValues.Text)
End Sub



trainee
__________________
trainee
 
Old June 8th, 2008, 09:54 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

And just as with your other post: do you mind telling us what exactly the problem is?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Image Handler Click Event daniel.mihalcea C# 2008 aka C# 3.0 12 March 12th, 2010 06:29 AM
dowload image when click on a button kumiko Classic ASP Basics 1 January 24th, 2008 10:43 AM
double click problem naveed77 Beginning VB 6 0 December 4th, 2007 03:49 AM
Mark a point in Image and handle click event on it savan_thakkar ASP.NET 1.0 and 1.1 Professional 3 June 9th, 2006 02:56 AM
Disable Right-click for Save Image As... bekim Javascript How-To 5 January 7th, 2005 09:03 PM





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