What your looking at is code based on the asp:Silverlight
web server control but that control was discontinued from Silverlight 3 onwards.
Now we either use the object tag directly or knock up our own server controls to render our preference of object tag.
As an object tag it would look something like this:-
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param id="xapSource" runat="server" name="source" value="ClientBin/SilverlightApplication1.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50303.0" />
<param name="autoUpgrade" value="true" />
<param name="initParams" id="initParams" runat="server" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50303.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
</form>
Note the id and runat="server" on the source param. With that in place the page load could look something like this:-
protected void Page_Load(object sender, EventArgs e)
{
string xapPhysicalPath = Server.MapPath(xapSource.Attributes["value"]);
DateTime lastWrite = System.IO.File.GetLastWriteTime(xapPhysicalPath);
xapSource.Attributes["value"] = xapSource.Attributes["value"] + "?" + lastWrite.ToString("yyyyMMddThh:mm:ss");
}
This would ensure the url used for the source would always change when the xap has changed. The original code you've come across is flawed in that it is still possible for the xap to change without the entirely unconnected assembly version number changing.