views:

131

answers:

3

I am using Silverlight.CreateObject function to create a object tag with a xap which is dynamic i.e. it does it on a click on something. And when u click that back again it gets disappeared. When u click it again, it should show the XAP again without loading it again(as it has been downloaded once). All works fine in IE. But in Firefox when I click it again, it starts loading it again. In fiddler it is showing Private Cache for both IE and Firefox. Can someone help me?

A: 

Why are you adding this level of complexity? Why aren't you just setting the visibility style of the HTML DIV or OBJECT tag?

Michael S. Scherotter
Thanx for replying Michael.I'm doing so bcoz there are 7 to 8 silverlight components in the single page. So I don't want to make the page too slow. So I'm creating the silverlight object dynamically.now any ideas??
Manish
+1  A: 

In firefox, when you hide a DOM element that contains a SL app, the SL application is re-initialized. we used jQuery to remove the object tag, then hide the element:

$("#element object").remove(); $("#element").hide();

...before you do show() you have to re-create the SL object tag. above applies also when replacing a DOM element with $.ajax loaded content.

o_o
A: 

Hey Manish,

Could you try using the Silverlight.js 2.0 version from Microsoft. That might solve the caching issue?

theraneman
Hey Abhang. Now it's not in our hand. ;-)
Manish