Skip to main content

Microsoft Silverlight

Answered Question "click to activate and use this control" on IE for Silverlight 2.0 pageRSS Feed

(0)

sladapter
sladapter

All-Star

All-Star

17439 points

3,172 Posts

"click to activate and use this control" on IE for Silverlight 2.0 page

I keep getting "click to activate and use this control silverlight control" message when first load a silverlight 2.0 page on IE. It is very annoying. How can I get rid of this? I don't remember seeing this with Silverlight 1.1.

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

cschuman
cschuman

Member

Member

210 points

55 Posts

Re: "click to activate and use this control" on IE for Silverlight 2.0 page

There are some JavaScript libraries out there.  Check Google for them: http://www.google.com/search?q=click+to+activate+javascript&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a 

m.wawrusch
m.wawrusch

Member

Member

20 points

15 Posts

Re: "click to activate and use this control" on IE for Silverlight 2.0 page

Use the aspx Silverlight wrapper instead of instantiating the Silverlight object directly. That should do the trick.

 HTH

Martin

frefaln
frefaln

Member

Member

153 points

74 Posts

Re: "click to activate and use this control" on IE for Silverlight 2.0 page

Assuming you don't have a specific need to use the <object> tag in your HTML markup, here's how to avoid that nasty "click to activate" message (thanks Eolas):

- In your web site add a reference to System.Web.Silverlight.

- On your .aspx/.ascx add the following directive:

<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls" TagPrefix="asp" %>

- Then in your markup you'd add:

<div id="silverlightControlHost" >
 
<asp:ScriptManager ID="scriptmanager1" runat="server"></asp:ScriptManager>
 
<asp:Silverlight ID="silverLight1" runat="server" Source="~/ClientBin/YourXAPFile.xap" Visible="true" Version="2.0"></asp:Silverlight>
   . . . 
 

Hope this helps.

----------------------------------------
Darren Mart
Developer of Steel Saga, which amounted to little more than some free advertising for Silverlight. Glad to help.

jackbond
jackbond

Contributor

Contributor

2820 points

725 Posts

Re: "click to activate and use this control" on IE for Silverlight 2.0 page

sladapter:
It is very annoying. How can I get rid of this?

Well since you don't mind using beta software, there is a beta update to IE that gets rid of the Eolas blackmail work around, i.e. you don't have to "Click to Activate" anything.

http://support.microsoft.com/kb/947518

sladapter
sladapter

All-Star

All-Star

17439 points

3,172 Posts

Answered Question

Re: "click to activate and use this control" on IE for Silverlight 2.0 page

Update browser can only work for me as a developer. But I want to show my boss how the silverlight works. They would be pissed off if they have see that "click to activate and use this control" message everytime to load a page.

Anyway, this message only happens when I use the SilverlightTestPage.htm as test page.  I can use SilverlightTestPage.aspx to test so I would not get that annoying message. But I found some other problems with using aspx page to test. Like getting a runtime error when a image control does not have a valid source file.

So I modified SiverlightTestPage.htm file as following:

 <div id="silverlightControlHost">     
        <!-- Change the object tag to script tag -->

        <script type="text/javascript">     
            var objscript = '<object data="data:application/x-silverlight," type="application/x-silverlight-2-b1" width="100%" height="100%">';
            objscript += '<param name="source" value="ClientBin/MyTest.Silverlight.xap"/>'
            objscript += '<param name="onerror" value="onSilverlightError" />'
            objscript += '<param name="background" value="white" />'
            objscript += '<a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;">'
            objscript += '<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>';
            objscript += '</a>';
            objscript += '</object>';
        </script>


       <!-- The document.write(objscript) line has to be in a separate javascript include file -->
        <script type="text/javascript" src="JavaScript/fixit.js"></script>         

        <iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>                       
    </div>

the fixit.js only contains one line of code: document.write(objscript);

This works fine now. Thanks for all the suggestions.

 

 

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

WilcoB
WilcoB

Member

Member

720 points

137 Posts

Re: "click to activate and use this control" on IE for Silverlight 2.0 page

If you installed the Silverlight SDK, you can use the Silverlight.js script that was previously used by default. You can find this file somewhere in Program Files/Microsoft SDKs/Silverlight/v2.0.

- Wilco Bauwer (MSFT) / http://www.wilcob.com

rajesh shirpuram
rajesh s...

Contributor

Contributor

2314 points

505 Posts

Re: Re: &quot;click to activate and use this control&quot; on IE for Silverlight 2.0 page

Thanks sladapter for this solution... Smile

Thanks
Rajesh Shirpuram

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities