|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to update a Image control?In my document has an Image and a Buttom WebForm control.
The Buttom's Click event does Image.ImageUrl="Images\Graphic.jpg". I change the Graphic.Jpg content and click on the Buttom again but the page show the old file content. What do I need to do to show the new file content? Mauricio.
That is very odd behavior. I just set a test site up on my computer and everything works as suspected. I put an image control on the page and a button control as you described. I set the imageurl property for the image to be image1.gif. I then set the click event for the button to simply say image1.imageurl = "image2.gif", compiled and it changed the image just fine. I don't know if you might be experience a framework issue, a browser caching issue, or something along those lines, but it should be working as you suspected. I know this doesn't help too much, but it should at least let you know that your mind is not playing tricks with you. Your code should be correct. Aaron Hi Aaron,
You are sure, but the fact is that you changed the file name and I only changed the file content so the image isn't update when I click on the buttom. The fact is that I doesn't want change the file name, because I have a procedure in my site that change the file content with the same file name. I hope you can help me yet. For now, thanks a lot. Show quoteHide quote "Aaron Corcoran" wrote: > Mauricio. > > That is very odd behavior. I just set a test site up on my computer > and everything works as suspected. I put an image control on the page > and a button control as you described. I set the imageurl property for > the image to be image1.gif. I then set the click event for the button > to simply say image1.imageurl = "image2.gif", compiled and it > changed the image just fine. > > I don't know if you might be experience a framework issue, a browser > caching issue, or something along those lines, but it should be working > as you suspected. > > I know this doesn't help too much, but it should at least let you > know that your mind is not playing tricks with you. Your code should > be correct. > > Aaron > > Mauricio,
So what you are doing is simply copying a new image with the same name into your directory structure, then clicking the button which should refresh the page and bring up the new image? I do understand that you are trying to keep the same name of the image now, so it makes me think that there might be a possible caching problem on the client. What you may wish to do is try to do a response.redirect to the same page, to see if the image appears after the page is redirected? Aaron
Infragistics Ultra Web Grid Updating Problem
Listbox Webcontrol SelectedIndexChanged Event not working Who is the true Asp.Net MVP here? Trying hard to implement globalisation. Strange error message(urgent help needeed) Finding the leftmost pixel in a piece of text when using GDI+ load event doesn't fire unless init event is present Can't get the Microsoft Web Library How to view properties of control inside table Client Side Calculation involving controls in datagrid template co Automatically adjust TextBox's height |
|||||||||||||||||||||||