none
unknown tag asp:Silverlight

    Question

  • Hi,

    I'm trying to change from Silverlight 1.0 to 2.0. I've installed ASP.NET 3.5 Extensions CTP, Silverlight 2.0, Silverlight 2.0 SDK Beta1, Silverlight Tools Beta 1 for Visual Studio 2008. It's possible to drag Silverlight control from toolbox into page.xaml, but VS2008 says asp:Silverlight is unknown.

    When showing the TestPage.aspx or TestPage.html in browser, I can see only empty, white page.

    What am I missing?

    Greetings, Gabriel

    Tuesday, March 18, 2008 2:36 AM

Answers

  • Hello Gabriel, 

    #4. In your sample there is "~/ClientBin/SL2TestGabriel.xap". I think this is the reason for "../../". After removing - Big Smile - the page shows.

    You're great! Thank you!

     

    Your welcome :)

    But in VS2008 I get same error as before: unknown tag asp:Silverlight.
     

    The sample that I send you is working fine in your local machine, right? 

    Mapping harddrive is not good idea because there might be a lot of issues (remoting debugging or etc) and also, I can't test it for in my env since our live web server is not within our IP range. I simply upload the projects when I have finished developing the application. The thing is that you should not get "unknown tag asp:Silverlight" in your local machine when you are working with SL project that located in your machine only. You can upload the project once you have finished.

    If you add asp:Silverlight control to ASP.NET project that you hosted SL content, you wil get the error that I posted in my previous thread. You can remove it the line from web.config as I mentioned my previous post.

    Hope it helps.  

    Wednesday, March 19, 2008 3:03 AM

All replies

  •  

    It's possible to drag Silverlight control from toolbox into page.xaml, but VS2008 says asp:Silverlight is unknown.

    No. asp:Silverlight control is for ASP.NET ext project. not for Silverlight.

    When showing the TestPage.aspx or TestPage.html in browser, I can see only empty, white page.

    What am I missing?

    Have you set the path of xap to asp:Silverlight control?  

    For example: <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SL2HttpPost.xap" Version="2.0" Width="100%" Height="100%" />

    Tuesday, March 18, 2008 3:42 AM
  • Thank you for your answer.

    The asp:Silverlight tag was set by VS2008 and points correct at xap file - but VS2008 says also it is unknown tag ( it is in aspx, not in xaml as I wrote ). I can also drag second asp:Silverlight into aspx file, it is placed, but now I have two errors.

    In web.config I have:

    <pages>
     
    <controls>
        <
    add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <
    add tagPrefix="asp" namespace="System.Web.UI.SilverlightControls" assembly="System.Web.Silverlight" />
      </
    controls>
    </
    pages>

    The page itself is placed as virtual directory under root.

    Tuesday, March 18, 2008 3:59 AM
  • it is in aspx, not in xaml as I wrote
     

     

    You wrote "It's possible to drag Silverlight control from toolbox into page.xaml, but VS2008 says asp:Silverlight is unknown. "

    That's why I thought you drag  asp:control in page.xaml. I dont have this code "System.Web.UI.SilverlightControls" in web.config.

    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    Tuesday, March 18, 2008 5:15 AM
  • I've changed the 2 lines in web.config, but nothing changes.

    Greetings, Gabriel

    Tuesday, March 18, 2008 5:31 AM
  • Okay. let's do one thing.

     

    1. Open VS 2008. 

    2. Create new Silverlight 2 Application 

     

    3. Attach the ASP.NET project.

     

     4. Go to YourSLapplicationTestPage.aspx. (You will see the following code.)

    <%@ Page Language="C#" AutoEventWireup="true" %>

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

    <!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" style="height:100%;">
    <head runat="server">
        <title>Test Page For SilverlightApplication1</title>
    </head>
    <body style="height:100%;margin:0;">
        <form id="form1" runat="server" style="height:100%;">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <div  style="height:100%;">
                <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SilverlightApplication1.xap" Version="2.0" Width="100%" Height="100%" />
            </div>
        </form>
    </body>
    </html>

     

    Tuesday, March 18, 2008 5:45 AM
  • I've done all steps. But asp:Silverlight is green underlined ...

    Tuesday, March 18, 2008 7:02 AM
  •  Make sure you have installed the following.

    1. SL 2 runtime
    2. SL 2 SDK
    3. SL 2 Tool for VS 2008
    4. ASP.NET 3.5 ext

    I think you already have those things in your machine.

    Please download the sample from this link http://michaelsync.net/demo/SL2TestGabriel.zip 

    Please try to run this sample in your machine and let me know whether it's working fine or not.  

    Tuesday, March 18, 2008 7:18 AM
  • I've installed all 4 tools on my local PC and 1+2+4+SL2 SDK on web server.

    I've stored your files on local PC - all OK, but when I store it on web server ( drive mapped to W:\ ) the asp:Silverlight tag is green underlined.

    In both cases I see white page in browser.

    Greetings, Gabriel

    Tuesday, March 18, 2008 7:35 AM
  • I've found something:

    on local PC I can see xaml controls from html but only empty page from aspx

    on web server both aspx and html are showing white page.

    Greetings, Gabriel

    Tuesday, March 18, 2008 7:54 AM
  • I've stored your files on local PC - all OK
     

    All okay? Have you tried to run it from VS 2008? maybe, just re-build the application and run it again. 

    If you are still getting white page,

    #1. please check the toolbar of this forum. Let me know whether you are able to see it o not.

    #2. Are you able to run other Silverlight 2 website in your machine?

    #3. Please visit to this site (http://memorabilia.hardrock.com/) in your machine. let me know whether you are able to see this site in your browser.

    but when I store it on web server ( drive mapped to W:\ ) the asp:Silverlight tag is green underlined.
     

    I don't think mapping is gonna work. Anyway, let's solve the problem in your machine first. then, we will think about web server..

    Tuesday, March 18, 2008 7:57 AM
  • When I run the page under VS2008, both aspx and html are working ( I see xaml content ).

    From my local IIS 5.1 I see content only with html, not aspx ( but here Silverlight context menu ).

    From server IIS 6.0 I see empty page ( but with Silverlight context menu ) in aspx and html.

    Greetings, Gabriel

    Tuesday, March 18, 2008 9:08 AM
  • Hello Gabriel,

    Cool, not bad. :)

    Please register MIME for xap extension in IIS. If you don't know how to do that, please take a look this post. http://simplesilverlight.wordpress.com/2008/03/07/register-xap-file-in-iis/

    Tuesday, March 18, 2008 10:11 AM
  • It was already done, this is not the problem:

    Tuesday, March 18, 2008 10:37 AM
  • For your earlier error,

    Did you get the error below when you add "asp:Silverlight" control to ASP.NET project?

    Error    2    The type 'System.Web.UI.ScriptManager' exists in both 'c:\Windows\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\Windows\assembly\GAC_MSIL\System.Web.Extensions\3.6.0.0__31bf3856ad364e35\System.Web.Extensions.dll'    C:\Michael Sync\MyTechRoom\Silverlight\MyCreation\SL2TestGabriel\SL2TestGabriel_Web\SL2TestGabrielTestPage.aspx    14

    You can solve it by removing " <add assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>"  from web.config.

    From my local IIS 5.1 I see content only with html, not aspx ( but here Silverlight context menu ).

    From server IIS 6.0 I see empty page ( but with Silverlight context menu ) in aspx and html.

    #1. Are you running my sample on your server? or other project? I suggest you to upload my sample on your server and try to surf the website from the machine that has Silverlight installed.

    #2. Have you tried accessing your SL page from both IE and Firefox?

     

    Tuesday, March 18, 2008 11:32 AM
  • No, I didn't get error about ScriptManager in 2 files.

    I've installed your sample on both machines:
    1. my local machine with IIS 5.1, where html is ok, but aspx not
    2. our web server with IIS 6.0, which is drive mapped over LAN and where I directly create all my projects from VS. After installing I go to url http://www.gabriel-gnatowski.de/sl/sl2testgabriel_web/SL2TestGabrielTestPage.aspx or http://www.gabriel-gnatowski.de/sl/sl2testgabriel_web/SL2TestGabrielTestPage.html

    Greetings, Gabriel

    Tuesday, March 18, 2008 12:11 PM
  • One more: Firefox shows empty pages on server.

    Tuesday, March 18, 2008 12:13 PM
  • #1. Can you try to remove "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">?

    #2.  Did you make some changes in aspx file?

    #3. Are you able to run the normal ASP.NET project on your server?

    #4. Why "../../"?  I think it should be "ClientBin/SL2TestGabriel.xap" (remove "../../")

     

    ../../ClientBin/SL2TestGabriel.xap

     

    Tuesday, March 18, 2008 11:21 PM
  • #1. Removed - no changes seen

    #2. I've nothing changed in aspx file.

    #3. We have some ASP.NET / AJAX pages

    #4. In your sample there is "~/ClientBin/SL2TestGabriel.xap". I think this is the reason for "../../". After removing - Big Smile - the page shows.

    You're great! Thank you!

    But in VS2008 I get same error as before: unknown tag asp:Silverlight.

    Greetings, Gabriel

    Wednesday, March 19, 2008 2:43 AM
  • I've discovered ASP.NET Extensions in the toolbox. There is another Silverlight component. When I drag it into aspx page, I get <cc1:Silverlight .../> without error. But <asp:Silverlight .../> was created by VS2008 automatically. Is there maybe an error in web.config?

    Greetings, Gabriel

    Wednesday, March 19, 2008 2:48 AM
  • Hello Gabriel, 

    #4. In your sample there is "~/ClientBin/SL2TestGabriel.xap". I think this is the reason for "../../". After removing - Big Smile - the page shows.

    You're great! Thank you!

     

    Your welcome :)

    But in VS2008 I get same error as before: unknown tag asp:Silverlight.
     

    The sample that I send you is working fine in your local machine, right? 

    Mapping harddrive is not good idea because there might be a lot of issues (remoting debugging or etc) and also, I can't test it for in my env since our live web server is not within our IP range. I simply upload the projects when I have finished developing the application. The thing is that you should not get "unknown tag asp:Silverlight" in your local machine when you are working with SL project that located in your machine only. You can upload the project once you have finished.

    If you add asp:Silverlight control to ASP.NET project that you hosted SL content, you wil get the error that I posted in my previous thread. You can remove it the line from web.config as I mentioned my previous post.

    Hope it helps.  

    Wednesday, March 19, 2008 3:03 AM
  • There are 2 controls for hosting Silverlight apps in circulation.  One is in the ASP.NET Extensions and was released a while back; that's the cc1:Silverlight.  The other is new and ships in the Silverlight 2 SDK (IIRC; it's pretty jumbled).  If you use the second one, you should get the following in your .aspx page:

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

    Wednesday, March 19, 2008 12:22 PM
  • Had the same problem it appears that the System.Web.Silverlight assembly needs to be added to the GlobalAssemblyCache. Solution is to open the assembly viewer by navigating to  C:\Windows\Assembly in file explorer then drag and drop c:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server\System.Web.Silverlight.dll onto the assembly viewer, rebuild the solution in VS and problem should disappeaar

    Frank

    Thursday, April 24, 2008 8:45 AM