C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

Image in a listview column click


Posted Date: 06 Nov 2009      Posted By: urpalshu      Member Level: Gold     Points: 1   Responses: 1



Hi!

I have a listview with couple columns and the last column says Remove

I have an image on each row , when the user clicks on the image I want to have an event fired on the server.

Please could somebody help with syntax, I am not sure how an image can have a click event fired



<asp:ListView ID="lvAuthStores" runat="server" >
<ItemTemplate>
<td>
<%# Eval("CustomerID")%>

</td>
<td >
<%# Eval("CustomerName")%>
</td>
<td>
<img id="Img2" runat="server" src="~/images/icon/delete.gif" alt="Remove" onclick="" class="imgIcon" /></a>
</td>
</ItemTemplate>
</asp:ListView>
protected void Remove_Click(object sender, EventArgs e)
{

}





Responses

Author: Satish Kumar J    10 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Instead of using html image control use ASP.NET Image Button control so that you can assign on click event to that control

please check example at MSDN
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.imagebutton.aspx

HTH

Regards,
Satish
My Blog



Post Reply
You must Sign In to post a response.
Next : How to display a progress bar while executing a long method or an update statement?
Previous : Dynamic Controls
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use