I listed top 5 data by gridview. I use itemtemplate and hyperlink for them. An Idditon I have an Image. When I mouse over on hyperlink the image will be change. How can it ?
Cano82 0 Newbie Poster
Recommended Answers
Jump to Post— mellamokb 8Hi Cano82,
You need to add some javascript in the "onMouseOver" event of the hyperlink that changes the image. Here is an example of a link and image, where mousing over the link changes the source of the image, and mousing out of the link changes the image back …
Jump to Post— mellamokb 8The onMouseOver attribute is not part of the server-side tag, so it doesn't support DataBinding (<%# Eval("Picture") %>). However, you can use the GridView's RowDataBound event to access each HyperLink separately and set their onMouseOver attributes to the correct value as follows:
---- myPage.aspx ----
<asp:GridView …
Jump to Post— mellamokb 8My mistake. Please change this code:
i.UniqueIDto the following:
i.ClientIDThen it should work. Please post back if you have any more problems.
~ mellamokb
All 9 Replies
mellamokb 8 Light Poster
Cano82 0 Newbie Poster
mellamokb 8 Light Poster
Cano82 0 Newbie Poster
Cano82 0 Newbie Poster
mellamokb 8 Light Poster
Cano82 0 Newbie Poster
mellamokb 8 Light Poster
Cano82 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.