469,159 Members | 1,428 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,159 developers. It's quick & easy.

Photo Rotate Image Cached

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

Nov 19 '05 #1
3 2299
I also tried to set the outputcache of the page to 1 second and it
still is not working.
Thanks,
Jon

Nov 19 '05 #2
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

"byrd48" <by*****@rocketmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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

Nov 19 '05 #3
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("UserG allery")).Tables(0).Rows(e.Item.ItemIndex).Item("P hotoName"),
Session("UserID"))

' rotate the thumb left
Me.m_class_photo.ThumbRotate("l",
Me.m_Class_Gallery.Gallery_Retrieve(Session("UserG allery")).Tables(0).Rows(e.Item.ItemIndex).Item("P hotoName"),
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("UserG allery")).Tables(0).Rows(e.Item.ItemIndex).Item("P hotoName"),
Session("UserID"))

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

bindlist()
End Sub

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mullin Yu | last post: by
7 posts views Thread by Showjumper | last post: by
3 posts views Thread by Diego F. | last post: by
reply views Thread by deerhack | last post: by
3 posts views Thread by CSharper | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.