HTML Object Tag and Silverlight Plugin Reload

Tuesday, September 16, 2025
This is a repost from my old blog. First posted in 10/6/2016.

I have a Silverlight plugin that I don't want it to be refreshed or reloaded. But in my case, it always reloaded itself though nothing on the page caused a postback. Later on, I found out that I have a javascript code that hide and show the container of the plugin (div with id of someDiv in the code below).

<div id="someDiv">
  <object data="data:application/x-silverlight-2," type="application/x-silverlight-2">
  ...
  </object>
</div>

Apparently that causes the object tag to reload the plugin. My workaround thus is to set the height of the object tag to 0 px, that solves the problem.