Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Avoid "Click to active and use this control"
5 replies. Latest Post by Qbus on October 11, 2008.
(0)
Qbus
Member
607 points
269 Posts
10-11-2008 6:18 AM |
When you deploy a silverlight application using the "ASP.NET 3.5" way by inserting a ScripManager and a SilverlightControl to embed your app, all seems to work great!
But what if you are going to deploy your app to a ASP.NET 1.1, ASP.NET 2.0, ASP, PHP, JSP or what ever site?
I know you can insert your app using the normal <object> html tag with the right type, no problems there. My problem is that if I'm doing that I get this "Click to active and use this control" message around my app in IE, which looks very stupid.
How to I avoid this? Should I use the Silverlight.js file here to embed the app through JavaScript?
Thanks in advance,
preishuber
Contributor
3570 points
655 Posts
10-11-2008 6:40 AM |
the "click to activate" should be away with newest patches. Was a workaround causing from legal issues. Some company had a patent
http://blogs.msdn.com/ie/archive/2007/11/08/ie-automatic-component-activation-changes-to-ie-activex-update.aspx
10-11-2008 6:45 AM |
Do you mean the RC0 release? It should be gone there?
Herthoren
85 points
82 Posts
10-11-2008 7:10 AM |
I believe he meant latest patches for Internet Explorer.
AFAIK this problem is unrelated to silverlight.
Have you tried getting the latest updates for IE?
http://www.microsoft.com/windows/downloads/ie/getitnow.mspx
or http://windowsupdate.microsoft.com
Ok, I google it a bit more my self. This is not something that is removed in the newest patch of Silverlight, but in a patch for IE.
I found some sample of how to work around this, assuming that not ALL my users have the newest patch for IE (my virtual machine didn't for instance). Not of the samples work our of the box. Therefore I essembled my own here:
You can use it as you want :)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <script src="Silverlight.js" type="text/javascript"></script> </head> <body> <div id="SilverlightContent"> Silverlight not installed...please do so :) </div> <script language="javascript" type="text/javascript"> var parentElement = document.getElementById('SilverlightContent'); var altHTML = parentElement.innerHTML; Silverlight.createObject( "ClientBin/DeployTest.xap", // Source property value. parentElement, // DOM reference to hosting DIV tag. "myPlugin", // Unique plug-in ID value. { // Plug-in properties. width:'1024', // Width of rectangular region of plug-in in pixels. height:'530', // Height of rectangular region of plug-in in pixels. //background:'white', // Background color of plug-in. //isWindowless:'false', // Determines whether to display plug-in in windowless mode. //framerate:'24', // MaxFrameRate property value. version:'2.0', // Silverlight version. alt: altHTML // Alternate HTML to display if Silveright is not installed }, { onError:null, // OnError property value -- event-handler function name. onLoad:null // OnLoad property value -- event-handler function name. }, null, // initParams -- user-settable string for information passing. null); </script> </body> </html>
10-11-2008 7:16 AM |
Herthoren:I believe he meant latest patches for Internet Explorer.AFAIK this problem is unrelated to silverlight.Have you tried getting the latest updates for IE?http://www.microsoft.com/windows/downloads/ie/getitnow.mspxor http://windowsupdate.microsoft.com
Yeah i figured out it were IE he were talking about :)
As i stated in my post above this one, my Virtual machine didn't had this patch, which is why I had my problem. My guess is there is some people out there that don't have it either, which is why I think it is a good idea to use this "work around" for some time.
Actually I'm updating my virtual machine right now :)
Thanks for all your fast replies.