[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Changing a imageurl in a datagrid when clicked on

Posted on 2004-10-20
8
Medium Priority
?
474 Views
Last Modified: 2008-02-01
I have a datagrid column where an imagebutton exists.  I want to be able to when a user clicks on that image button I change the imageurl to a different image.  I do not know how to declare in the code behind file a imagebutton in a datagrid.
0
Comment
Question by:aasaif00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 6

Expert Comment

by:Praesidium
ID: 12363569
A single image button?  Or multiples?  Static?
0
 

Author Comment

by:aasaif00
ID: 12364501
a single image button which contains a imageurl set to a image in my project
it belongs to a column in a datagrid
0
 
LVL 6

Accepted Solution

by:
zulu_11 earned 252 total points
ID: 12366671
you can use javascript to change the src of the image at runtime..
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 6

Assisted Solution

by:Praesidium
Praesidium earned 248 total points
ID: 12366702
Right, you can code your C# so that it will write the javascript for you... something like:

YourImageButtonName.Attributes.Add("onMouseOver","this.firstChild.src='/media/images/nav-Roll.gif'");

and so on and so forth, with onclick, mouseout, etc etc.
0
 

Author Comment

by:aasaif00
ID: 12369525
However it is possibe to find a imagebutton control within a Datagrid right, if i can do that it would be so much easier
0
 

Author Comment

by:aasaif00
ID: 12370284
ImageButton Btn1      =(ImageButton)e.Item.FindControl("ImageButton1");

i got it thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question