Photo Rotate Image Cached

B

byrd48

Hi,
I am developing a web site which allows users to upload and share
photos. I have a datalist which lists the photos and has the usual
edit, update commands.
Within the edititemtemplate, I have links to allow the user to rotate
the photo 90 degrees left or right. After I rebind the datalist,the
photo is not rotated on the web page, although it correctly rotated on
the server. If I click refresh, it updates, but calling refresh causes
it to submit the rotate command again,and the photo shows as having
been rotated twice (180 degrees).
How can I force the page to upload the newly rotated photo after the
command event from the datalist?
Thanks in advance for your help.

Jon
 
B

byrd48

I also tried to set the outputcache of the page to 1 second and it
still is not working.
Thanks,
Jon
 
B

byrd48

Hi,
I'm not calling the page through a URL, here is the code that is
executed on the codebehind when the user clicks the rotate left or
rotate right button.

Thanks,

Jon

Sub DataList_RotatePhoto(ByVal sender As Object, ByVal e As
DataListCommandEventArgs) Handles DataList1.ItemCommand
If e.CommandArgument = "rotateleft" Then
'rotate the photo left
Me.m_class_photo.PhotoRotate("l",
Me.m_Class_Gallery.Gallery_Retrieve(Session("UserGallery")).Tables(0).Rows(e.Item.ItemIndex).Item("PhotoName"),
Session("UserID"))

' rotate the thumb left
Me.m_class_photo.ThumbRotate("l",
Me.m_Class_Gallery.Gallery_Retrieve(Session("UserGallery")).Tables(0).Rows(e.Item.ItemIndex).Item("PhotoName"),
Session("UserID"))
End If

If e.CommandArgument = "rotateright" Then
'rotate the photo right
Me.m_class_photo.PhotoRotate("r",
Me.m_Class_Gallery.Gallery_Retrieve(Session("UserGallery")).Tables(0).Rows(e.Item.ItemIndex).Item("PhotoName"),
Session("UserID"))

' rotate the thumb right
Me.m_class_photo.ThumbRotate("r",
Me.m_Class_Gallery.Gallery_Retrieve(Session("UserGallery")).Tables(0).Rows(e.Item.ItemIndex).Item("PhotoName"),
Session("UserID"))
End If

bindlist()
End Sub
 
E

Eliyahu Goldin

Jon,

Trick the browser by adding a random query parameter to the image url. I use
the millisecond part of current time:

function random(){
return (new Date()).getMilliseconds();
}

The url will look like

"getPhoto.aspx?"+random()

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top