Hi..
I have a button to preview image using the following code, which
preview the image in html page:
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
Me.ClearControls(imgMap)
imgMap.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
I've set the URL for the image at the HTML code of asp web form as
follows:
<asp:Image id="imgMap" runat="server" Height="481px" Width="587px"
ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
The image resides at the server and always be changed based on users'
selection. The first try of clicking the preview button, it works
successfully. However, when the image has been changed, clicking at
the button again will not preview the latest image. It gives the same
image as previously. But, I will only get the latest image when I
click on the IE refresh button. How could I get the latest image
automatically without pressing at the IE refresh button? Anyone can
help me to solve this...?
Thanks for any help.. 11 12173
On Feb 26, 7:52 am, nuhur...@yahoo.com wrote:
Hi..
I have a button to preview image using the following code, which
preview the image in html page:
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
Me.ClearControls(imgMap)
imgMap.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
I've set the URL for the image at the HTML code of asp web form as
follows:
<asp:Image id="imgMap" runat="server" Height="481px" Width="587px"
ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
The image resides at the server and always be changed based on users'
selection. The first try of clicking the preview button, it works
successfully. However, when the image has been changed, clicking at
the button again will not preview the latest image. It gives the same
image as previously. But, I will only get the latest image when I
click on the IE refresh button. How could I get the latest image
automatically without pressing at the IE refresh button? Anyone can
help me to solve this...?
Thanks for any help..
you can try to add in your Page_Load
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
and see if it helps
The image is cached on client side. You can trick the browser into
re-loading it from the server by adding a random query parameter to the
image url:
ImageUrl="/mySystem/ExportImage.gif +(new Date()).getMilliseconds()"
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
<nu******@yahoo.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
Hi..
I have a button to preview image using the following code, which
preview the image in html page:
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
Me.ClearControls(imgMap)
imgMap.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
I've set the URL for the image at the HTML code of asp web form as
follows:
<asp:Image id="imgMap" runat="server" Height="481px" Width="587px"
ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
The image resides at the server and always be changed based on users'
selection. The first try of clicking the preview button, it works
successfully. However, when the image has been changed, clicking at
the button again will not preview the latest image. It gives the same
image as previously. But, I will only get the latest image when I
click on the IE refresh button. How could I get the latest image
automatically without pressing at the IE refresh button? Anyone can
help me to solve this...?
Thanks for any help..
On Feb 25, 11:11 pm, "Alexey Smirnov" <alexey.smir...@gmail.com>
wrote:
On Feb 26, 7:52 am, nuhur...@yahoo.com wrote:
Hi..
I have a button to previewimageusing the following code, which
preview theimagein html page:
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
Me.ClearControls(imgMap)
imgMap.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
I've set the URL for theimageat the HTML code ofaspweb form as
follows:
<asp:Imageid="imgMap" runat="server" Height="481px" Width="587px"
ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
Theimageresides at the server and always be changed based on users'
selection. The first try of clicking the preview button, it works
successfully. However, when theimagehas been changed, clicking at
the button again will not preview the latestimage. It gives the same
imageas previously. But, I will only get the latestimagewhen I
click on the IErefreshbutton. How could I get the latestimage
automatically without pressing at the IErefreshbutton? Anyone can
help me to solve this...?
Thanks for any help..
you can try to add in your Page_Load
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
and see if it helps- Hide quoted text -
- Show quoted text -
Alexey,
I've tried your code, but it still doesn't work --it picks-up the
previous image. Any idea??
On Feb 26, 8:31 am, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
The image is cached on client side. You can trick the browser into
re-loading it from the server by adding a random query parameter to the
image url:
ImageUrl="/mySystem/ExportImage.gif +(new Date()).getMilliseconds()"
a minor change: ImageUrl="/mySystem/ExportImage.gif?" +(new
Date()).getMilliseconds()"
On Feb 25, 11:31 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
Theimageis cached on client side. You can trick the browser into
re-loading it from the server by adding a random query parameter to theimageurl:
ImageUrl="/mySystem/ExportImage.gif +(new Date()).getMilliseconds()"
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net
<nuhur...@yahoo.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
Hi..
I have a button to previewimageusing the following code, which
preview theimagein html page:
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
Me.ClearControls(imgMap)
imgMap.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
I've set the URL for theimageat the HTML code ofaspweb form as
follows:
<asp:Imageid="imgMap" runat="server" Height="481px" Width="587px"
ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
Theimageresides at the server and always be changed based on users'
selection. The first try of clicking the preview button, it works
successfully. However, when theimagehas been changed, clicking at
the button again will not preview the latestimage. It gives the same
imageas previously. But, I will only get the latestimagewhen I
click on the IErefreshbutton. How could I get the latestimage
automatically without pressing at the IErefreshbutton? Anyone can
help me to solve this...?
Thanks for any help..- Hide quoted text -
- Show quoted text -
Hi Eliyahu,
I've tried to add a random query parameter to the image url as you
have suggested. But it makes the preview page doesn't show the image
at all... Any idea to solve this???
Thanks in advance for your help.
Just use Alexey's correction, I didn't have time to look in my typing when I
posted the first answer.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
<nu******@yahoo.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
On Feb 25, 11:31 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
>Theimageis cached on client side. You can trick the browser into re-loading it from the server by adding a random query parameter to theimageurl:
ImageUrl="/mySystem/ExportImage.gif +(new Date()).getMilliseconds()"
-- Eliyahu Goldin, Software Developer & Consultant Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net
<nuhur...@yahoo.comwrote in message
news:11**********************@q2g2000cwa.googlegr oups.com...
Hi..
I have a button to previewimageusing the following code, which
preview theimagein html page:
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
Me.ClearControls(imgMap)
imgMap.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
I've set the URL for theimageat the HTML code ofaspweb form as
follows:
<asp:Imageid="imgMap" runat="server" Height="481px" Width="587px"
ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
Theimageresides at the server and always be changed based on users'
selection. The first try of clicking the preview button, it works
successfully. However, when theimagehas been changed, clicking at
the button again will not preview the latestimage. It gives the same imageas previously. But, I will only get the latestimagewhen I
click on the IErefreshbutton. How could I get the latestimage
automatically without pressing at the IErefreshbutton? Anyone can
help me to solve this...?
Thanks for any help..- Hide quoted text -
- Show quoted text -
Hi Eliyahu,
I've tried to add a random query parameter to the image url as you
have suggested. But it makes the preview page doesn't show the image
at all... Any idea to solve this???
Thanks in advance for your help.
Thus wrote Alexey,
On Feb 26, 7:52 am, nuhur...@yahoo.com wrote:
>Hi..
I have a button to preview image using the following code, which preview the image in html page:
Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter) Me.ClearControls(imgMap) imgMap.RenderControl(oHtmlTextWriter) Response.Write(oStringWriter.ToString()) Response.End() I've set the URL for the image at the HTML code of asp web form as follows:
<asp:Image id="imgMap" runat="server" Height="481px" Width="587px" ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
The image resides at the server and always be changed based on users' selection. The first try of clicking the preview button, it works successfully. However, when the image has been changed, clicking at the button again will not preview the latest image. It gives the same image as previously. But, I will only get the latest image when I click on the IE refresh button. How could I get the latest image automatically without pressing at the IE refresh button? Anyone can help me to solve this...?
Thanks for any help..
you can try to add in your Page_Load
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
and see if it helps
Making the page non-cacheable won't help. The images are static content and
are served by IIS.
Cheers,
--
Joerg Jooss ne********@joergjooss.de
Thus wrote nu******@yahoo.com,
Hi..
I have a button to preview image using the following code, which
preview the image in html page:
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
Me.ClearControls(imgMap)
imgMap.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
I've set the URL for the image at the HTML code of asp web form as
follows:
<asp:Image id="imgMap" runat="server" Height="481px" Width="587px"
ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
The image resides at the server and always be changed based on users'
selection. The first try of clicking the preview button, it works
successfully. However, when the image has been changed, clicking at
the button again will not preview the latest image. It gives the same
image as previously. But, I will only get the latest image when I
click on the IE refresh button. How could I get the latest image
automatically without pressing at the IE refresh button? Anyone can
help me to solve this...?
See http://www.joergjooss.de/PermaLink,g...406ad4bdf.aspx
In order to "touch" the file programmatically, use System.IO.File.SetLastWriteTime().
Cheers,
--
Joerg Jooss ne********@joergjooss.de
On Feb 26, 1:36 pm, Joerg Jooss <news-re...@joergjooss.dewrote:
Thus wrote nuhur...@yahoo.com,
Hi..
I have a button to previewimageusing the following code, which
preview theimagein html page:
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
Me.ClearControls(imgMap)
imgMap.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
I've set the URL for theimageat the HTML code of asp web form as
follows:
<asp:Imageid="imgMap" runat="server" Height="481px" Width="587px"
ImageUrl="/mySystem/ExportImage.gif"></asp:Image>
Theimageresides at the server and always be changed based on users'
selection. The first try of clicking the preview button, it works
successfully. However, when theimagehas been changed, clicking at
the button again will not preview the latestimage. It gives the same
imageas previously. But, I will only get the latestimagewhen I
click on the IErefreshbutton. How could I get the latestimage
automatically without pressing at the IErefreshbutton? Anyone can
help me to solve this...?
Seehttp://www.joergjooss.de/PermaLink,guid,2316ed51-f87c-4249-924c-99d40...
In order to "touch" the file programmatically, use System.IO.File.SetLastWriteTime().
Cheers,
--
Joerg Jooss
news-re...@joergjooss.de- Hide quoted text -
- Show quoted text -
Thanks Joerg, I've read your article and try it, it works!! The latest
image is showed. But why the browser doesn't automatically resubmit
the information of the system back to me when I click on the IE "Back/
Previous" button? Meaning that I've to click on the Refresh button in
order to get the information.
Another thing that I'm confusing is about the setting for the Custom
HTTP Header Name and Value. What is the purpose of the Custom Header
Value and is the there any standards that I've to follow or I can put
anything?
Thanks a lot for your help...
On Feb 27, 2:28 am, nuhur...@yahoo.com wrote:
Thanks Joerg, I've read your article and try it, it works!! The latest
image is showed. But why the browser doesn't automatically resubmit
the information of the system back to me when I click on the IE "Back/
Previous" button? Meaning that I've to click on the Refresh button in
order to get the information.
because it use the cache http://support.microsoft.com/kb/234067
On Feb 27, 10:19 am, "Alexey Smirnov" <alexey.smir...@gmail.com>
wrote:
because it used the cache This discussion thread is closed Replies have been disabled for this discussion. Similar topics
9 posts
views
Thread by Mark |
last post: by
|
1 post
views
Thread by SPQR |
last post: by
|
6 posts
views
Thread by Arnold |
last post: by
|
1 post
views
Thread by Marco Maroni |
last post: by
|
2 posts
views
Thread by Just D. |
last post: by
|
1 post
views
Thread by Andre |
last post: by
|
17 posts
views
Thread by SamSpade |
last post: by
|
10 posts
views
Thread by Fred Nelson |
last post: by
|
11 posts
views
Thread by Jerry J |
last post: by
|
5 posts
views
Thread by mattcolenutt |
last post: by
| | | | | | | | | | |