none
object tag problem in silverlight 3

    Question

  • Hi,

      I am having trouble using object tag in silverlight 3, when I browse the page it gives me an error "Parser Error...An object tag must contain a Class, ClassID or ProgID attribute.". I am
    following sample created by Jesse Liberty using Silverlight 2 in Silverlight 3. How can fixed this problem?


    <div  style="height:100%;">  
       <object id="XamlObj1" runat="server" type="application/x-silverlight-2" data="data:application/x-silverlight," width="100%" height="100%" style="display:block" >
     <param name="minRuntimeVersion" value="3.0.40624.0" />
     <param name="autoUpgrade" value="true" />
     <param name="source" value="~/ClientBin/SqlData.xap" />
       </object> 
       <%--<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SqlData.xap" MinimumVersion="2.0.30911.0" Width="100%" Height="100%" />--%>
    </div>

    Thursday, September 03, 2009 3:13 AM

Answers

  • 2 things,

    Remove Runnt ="Server" in the object tag

    and

    remove ~/ in the param "source", instead use <param name="source" value="ClientBin/SqlData.xap"/>

    e.g:

    <div style="height: 100%;">

    <object id="SLExternal" data="data:application/x-silverlight," type="application/x-silverlight-2"

    width="100%" height="100%">

    <param name="source" value="ClientBin/SilverlightTest.xap" />

    <param name="background" value="white" />

    <param name="minRuntimeVersion" value="2.0.31005.0" />

    <param name="autoUpgrade" value="true" />

    <param name="enablehtmlaccess" value="true" />

    <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">

    <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"

    style="border-style: none" />

    </a>

    </object>

    </div>

    Thursday, September 03, 2009 3:26 AM
  • This is because you are missing the System.Web.Silverlight.dll in the Bin folder of the ASP Net Applciation

    Wednesday, September 09, 2009 12:50 AM

All replies

  • 2 things,

    Remove Runnt ="Server" in the object tag

    and

    remove ~/ in the param "source", instead use <param name="source" value="ClientBin/SqlData.xap"/>

    e.g:

    <div style="height: 100%;">

    <object id="SLExternal" data="data:application/x-silverlight," type="application/x-silverlight-2"

    width="100%" height="100%">

    <param name="source" value="ClientBin/SilverlightTest.xap" />

    <param name="background" value="white" />

    <param name="minRuntimeVersion" value="2.0.31005.0" />

    <param name="autoUpgrade" value="true" />

    <param name="enablehtmlaccess" value="true" />

    <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">

    <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"

    style="border-style: none" />

    </a>

    </object>

    </div>

    Thursday, September 03, 2009 3:26 AM
  • Thanks after apply your suggestion no error when I browse the aspx page, but how can I access the object (like asp:silverlight control) can access at server-side at runtime?
    Thursday, September 03, 2009 10:13 PM
  • Thanks after apply your suggestion no error when I browse the aspx page, but how can I access the object (like asp:silverlight control) can access at server-side at runtime?
    I dont think you can run <object> on server, To run it on server RUNAT=server should be specified; I think this is not supported,
    If you want to access it in code behind, asp:silverlightControl can be use instead Right ?, Is there any problem in doing that ?

    Check this

    http://bytes.com/topic/c-sharp/answers/609741-access-object-code-behind-flash-movie

    Friday, September 04, 2009 2:03 AM
  • So, right now when using silverlight 3 I need to use object tag and cannot be accessed at server-side like other html controls, I need to use Silverlight 2 asp:silverlight control when I want to access it at server-side, my next question, will silverlight control be functioning ok in pc where silverlight 3 is installed??

     

    Monday, September 07, 2009 9:56 PM
  • Your objective is to acces the silverlight (Version 3) control @ server side; Correct ? To do this,

    1. Register the assembly

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

    TagPrefix="asp" %>

    2.Add the control

    <form id="form1" runat="server" style="height:100%;">

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

    <div style="height:100%;">

    <asp:Silverlight ID="SilverlightControl" runat="server" Source="~/ClientBin/SilverlightTest.xap" MinimumVersion="3.0.40307.0" Width="100%" Height="100%" />

    </div>

    </form>

    3. Using the ID, Access the control

    e.g:

    SilverlightControl.InitParameters = "Something";

    will silverlight control be functioning ok in pc where silverlight 3 is installed?? You mean to say Will Silverlight 2 application will work in a PC where silverlight 3 is installed, if So YES is the answer

    Tuesday, September 08, 2009 1:38 AM
  • What you proposing does not work after followed #1 and #2?

    Silverlight 2 is not installed, only silverlight 3...

    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Could not load file or assembly 'System.Web.Silverlight' or one of its dependencies. The system cannot find the file specified.

    Source Error:

    Line 2:  
    Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    Line 4:  <%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls" TagPrefix="asp" %>
    Line 5:  
    Line 6:  

     

    Tuesday, September 08, 2009 9:44 PM
  • This is because you are missing the System.Web.Silverlight.dll in the Bin folder of the ASP Net Applciation

    Wednesday, September 09, 2009 12:50 AM
  •  This is correct...With Silverlight 3, the need to have the System.Web.Silverlight.dll included is gone due to the object tag being used... This means that your silverlight object is hosted by an object tag instead of using the silverlight reference. System.Web.Silverlight.dll is included in the 2.0 sdk and should be located in C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server... I would not suggest using this at all... I have stripped the reference from my project and no longer use <asp:Silverlight ........ instead, use the new standard... This takes away your reliance on an outdated control that most likely will not be used nor supported in the future.

     see: http://weblogs.asp.net/lduveau/archive/2009/07/22/silverlight-3-object-tag-param-list-aka-where-is-my-asp-silverlight-control.aspx

    <div id="silverlightControlHost" style="height: 100%; width: 100%">
            <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
                width="100%" height="100%">
                <param name="source" value="ClientBin/MYSILVERLIGHTAPP.xap" />
                <param name="onError" value="onSilverlightError" />
                <param name="background" value="white" />
                <param name="minRuntimeVersion" value="3.0.40624.0" />
                <param name="autoUpgrade" value="true" />
                <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none">
                    <img src="http://go.microsoft.com/fwlink/?LinkId=108181" 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>

    Wednesday, September 09, 2009 10:34 AM
  • Neal,

       Thanks for the info...I have not installed silverlight 2, i tried it later or next week.

    j-ottone,

      Thanks for the reply...I have not installed silverlight 2... 

     

    Wednesday, September 09, 2009 10:40 PM
  • can I know what is the iframe for?

    <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px;width: 0px;border: 0px"></iframe>

    Thursday, December 10, 2009 6:20 AM