I have been studying the Zermatt code samples over the weekend in order to see how I can issue a managed card to an authenticated user of my web application that uses Windows Live Id authentication service. So after a user is authenticated, there is a button to be clicked to download the infocard. When I tested this on Firefox 3.0, the download worked fine. But on IE 7, I got an error message.
---------------------------
Windows Internet Explorer
---------------------------
Internet Explorer cannot download signin.aspx from localhost. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
---------------------------
OK
---------------------------
This was happening because of the following statement in Page Load event
Response.Cache.SetCacheability(HttpCacheability.NoCache);
was causing the download of the infocard to fail.
What does this statement do?
With this statement in the code, the response sent back to the client has "Cache-Control: no-cache" in the header.
Why should this error occur on IE, but not firefox?
IE, probably, handles "no-cache" setting without errors when the response is "text/html" encoded. In my case, I was returning a "application/x-informationcardfile" in the response and I guess IE threw up the error message since it could not find how not to cache this response.
Firefox 3.0 just ignores the cache-control HTTP header.
I replaced the offending statement with
Response.Cache.SetNoStore();
and the file download works fine on both IE & Firefox.
References:
1. File download problem with Response.Cache.SetCacheability
2. Cache directives ignored by Firefox in ASP.NET caching.
Subscribe to:
Post Comments (Atom)
What is success?
The journey of life takes us through varied experiences like landing an admission at a prestigious college, earning a degree, getting hired,...
-
Recently after a domain password change, I got the following error in trying to run the webrole. Can not log on locally to WebRole as us...
-
I was trying my hands at creating a .NET 2.0 component that can be consumed by a COM application. One of the errors I got in the process of...
-
After editing the post-build event of my project in VS 2005, the following error came up "'Exec' task needs a command to execut...
No comments:
Post a Comment