hi,
i have a problem.
i am saving bitmaptextimage dynamically in data/image1.jpg every time when i redirect to the image.aspx page and i am assignning this image url to the image control.but image is not refreshing.if we press F5 or REFRESH button then image is refreshing.
i have used following techniques - Response.Cache.SetCacheability(HttpCacheability.NoCache);
-
Response.Cache.SetExpires(DateTime.Now-new TimeSpan(1,0,0));
-
Response.Cache.SetLastModified(DateTime.Now);
-
Response.Cache.SetAllowResponseInBrowserHistory(false);
-
-
<%@ OutputCache Duration="1" VaryByParam="None" %>
-
-
<meta http-equiv="refresh"
-
content="[n];url=http://www.microsoft.com/pagename.htm">
reply me please
6 1798
OutputCache location="none". HTH.
I've had good luck with -
Response.Cache.SetNoStore();
-
But you would need a way to set that header for the image request too.
I know this problem!
I had it a few months back.
I had to dynamically retrieve an image from a database and show it to the user based on their account...I allowed them to update this image and I was stuck with the old one displaying.......
Here's what happened:
I gave the image a name when I grabbed the image from the database and stored it temporarily in the folder where the web server could retrieve it...so it could be displayed in the web browser.
Every time this happens, the image is named the same thing (based on the user's login properties).
The browser grabbed that image and cached the image.
When the browser came back to the page, the old image would always appear because the browser didn't download the new image.
So to get around this problem I appended random numbers to the image name...forcing the browser to download the new image.
The meta tag that indicates "no-cache" did not help resolve this issue because this tag is used by ASP.NET, not your web browser.
It allows the ASP.NET technology to determine whether or not a cached version of the compiled ASP code should be used...
Setting this meta tag to "no-cache" indicates to the ASP.NET technology that the ASP code should be compiled every web-request.
I could be wrong about this...but I'm almost 100% sure.
Instead of writing a lot of temporary files, you could also create a serve-up page that responds back with "content-type: jpeg" and the jpeg data.
I use that for certain situations, helps control security a little better.
Instead of writing a lot of temporary files, you could also create a serve-up page that responds back with "content-type: jpeg" and the jpeg data.
I use that for certain situations, helps control security a little better.
Or you could overwrite the old jpegs with new :D
Or you could overwrite the old jpegs with new :D
My file system does not allow write access to the webservice for any of it's directories contained withen itself. So writing a bunch of temporary files that are available to the outside world through http is not permsible.
Just an alternative :-P
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bill Puetz |
last post by:
I have a form with 4 different Submit buttons. In the action code, I do a
request on the button names to see which one is valued. This all works
great, until the browser is refreshed -- the...
|
by: Micha³ Januszczyk |
last post by:
is there any way to tell whether the application has entered the shutdown
state ?
I put some data into aspnet cache. Special callback method is specified that
should be called when cache item is...
|
by: Charts |
last post by:
I used
HttpContext.Current.Cache To cache data from database.
The code is like that.
public static DataView GetCategories() {
if ( HttpContext.Current.Cache == null ) {...
|
by: JJ_377 |
last post by:
In a "Save and Quit" button on my web app form (aspx), I have the
following code that is supposed to clear a session variable (an user
id) and redirect to a logon page:
Session.Clear()...
|
by: PD |
last post by:
I am trying to stream out a PDF file via the response object and when I
execute the code it always brings up the first document that I pulled
up.Even when I step through the code, I can see the new...
|
by: Jake Barnes |
last post by:
I've a little webcam program that snaps a picture of me and uploads it
every 20 seconds. It automatically uploads the image to my server. It
always give the image the same name, and thus it...
|
by: negmat |
last post by:
Hello everyone,
I have the following question:
I am aware that the objects currently in the cache can be viewed by issuing the following command:
SELECT *
FROM master.dbo.Syscacheobjects
...
|
by: wardemon |
last post by:
Hi All,
I have a aspx page named: ImageProcess.aspx that creates a thumbnail
version of an image by passing the ImagePath, width, and height. The
ImagePath is taken from a table from a database,...
|
by: Nizha |
last post by:
Hi,
The browser cache is not getting clearing inspite of setting these headers..
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache");...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |