博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Avoid incorrect Silverlight XAP file caching
阅读量:5988 次
发布时间:2019-06-20

本文共 1351 字,大约阅读时间需要 4 分钟。

The code below appends the last-write filedate of the Silverlight Application XAP file to the path in the source parametre of the Silverlight object tag.

This will ensure that poorly constructed caching functionality of webbrowsers and proxy servers doesn’t incorrectly use old, wrong builds of the XAP file.
However it will still allow these caches to work. Furthermore a check is performed to avoid XAP file path alteration during debugging, this is to allow debugging tools such as Silverlight Spy to continue functioning.

<object id="Xaml1" data="data:application/x-silverlight-2," type="application/x-silverlight-2"

width="100%" height="100%">

<%––<param name="source" value="ClientBin/SilverlightApp.xap"/>––%>

<%

string orgSourceValue = @"ClientBin/SilverlightApp.xap";

string param;

if (System.Diagnostics.Debugger.IsAttached)

param = "<param name=\"source\" value=\"" + orgSourceValue + "\" />";

else

{

string xappath = HttpContext.Current.Server.MapPath(@"") + @"\" + orgSourceValue;

DateTime xapCreationDate = System.IO.File.GetLastWriteTime(xappath);

 

param = "<param name=\"source\" value=\"" + orgSourceValue + "?ignore="

+ xapCreationDate.ToString() + "\" />";

}

 

Response.Write(param);

%>

<param name="onError" value="onSilverlightError" />

http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file/#comment-20

转载地址:http://iyjlx.baihongyu.com/

你可能感兴趣的文章
tornado总结3-html模板使用1
查看>>
Hibernate主键生成策略
查看>>
Mac系统下安装mySQL数据库
查看>>
如何处理大量数据并发操作
查看>>
jsp自定义标签属性<body-content>值类型
查看>>
Smail代码调试LogUtil
查看>>
Java nio
查看>>
控制docker-compose中服务的启动顺序
查看>>
n后问题-回溯法
查看>>
谈英语交际能力的培养
查看>>
UDP通讯方式
查看>>
分享PHP 分页的写法
查看>>
SpringMvc+ibaits 文件上传的列子
查看>>
个帖子学会Android开发四大组件
查看>>
Windows安装和使用zookeeper
查看>>
onSaveInstanceState和onRestoreInstanceState
查看>>
java.lang.ClassNotFoundException: org.junit.Before
查看>>
字符串相似度
查看>>
ios app 推送功能 JPush极光推送的使用
查看>>
回答技巧
查看>>