Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. SL Content not displaying

SL Content not displaying

Scheduled Pinned Locked Moved WPF
javascripthelpcsharphtmlasp-net
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JMurfey
    wrote on last edited by
    #1

    Hi all - I added a Silverlight application to my solution - an asp.net website. It added an html and aspx file in the root, also a ClientBin dir. If I link to the html or aspx file, the SL content displays - in a page by itself. So, I tried to add the SL object to an asp:wizard page. I copied the div from the aspx and put it on the page. I also added the javascript error code and the link to the js file. The SL content wont show in the wizard. I set the source to "..\\ClientBin\..." and the js to "..\\silverlight.js" because the wizard is at the same level as the ClientBin content. changing the size and background of the object does work, and not adding ..\\ causes the javascript onerror code to execute. Can anyone let me know what else I need to do? Any help would be appreciated. Thanks! J

    D 1 Reply Last reply
    0
    • J JMurfey

      Hi all - I added a Silverlight application to my solution - an asp.net website. It added an html and aspx file in the root, also a ClientBin dir. If I link to the html or aspx file, the SL content displays - in a page by itself. So, I tried to add the SL object to an asp:wizard page. I copied the div from the aspx and put it on the page. I also added the javascript error code and the link to the js file. The SL content wont show in the wizard. I set the source to "..\\ClientBin\..." and the js to "..\\silverlight.js" because the wizard is at the same level as the ClientBin content. changing the size and background of the object does work, and not adding ..\\ causes the javascript onerror code to execute. Can anyone let me know what else I need to do? Any help would be appreciated. Thanks! J

      D Offline
      D Offline
      DotNetXenon
      wrote on last edited by
      #2

      Have you tried to change the width and height to pixels instead of %? This post may be of help : http://forums.silverlight.net/p/232055/569580.aspx[^]

      ------------------------------------------------------------ "The only true wisdom is in knowing you know nothing." --Socrates

      J 1 Reply Last reply
      0
      • D DotNetXenon

        Have you tried to change the width and height to pixels instead of %? This post may be of help : http://forums.silverlight.net/p/232055/569580.aspx[^]

        ------------------------------------------------------------ "The only true wisdom is in knowing you know nothing." --Socrates

        J Offline
        J Offline
        JMurfey
        wrote on last edited by
        #3

        Hi Xenon - thanks for the response. Yes I tried setting the height and width to pixels and I do get a box that will bring up the silverlight menu when you right click inside it, but thats all. Basically, if the pages that load the sl object are in the root of my project - like the test aspx and html pages added by default when the sl project is created - it works fine. If I try and load the sl object from a page in a folder (at the same level as ClientBin) It doesn't work. even if I copy the same html or aspx pages directly from the root. I have to change a couple things -

        becomes

        and

        becomes

        (I don't think the .js is being used, so I don't think I need to do this. If I don't change the ClientBin to ..\\ClientBin, I will get a load error thrown. Do I need to set mime types or something? I read something about them only being set for the root of the project directory. I am using VS2010. Thanks! J here's the page source I get -

        Silverlight Object
        .style1
            {
                width: 100%;
            }
        html, body {
            height: 100%;
            overflow: auto;
        }
        body {
            padding: 0;
            margin: 0;
        }
        #silverlightControlHost {
            height: 500px;
            text-align:center;
        }
        
        
        
            function onSilverlightError(sender, args) {
                var appSource = "";
                if (sender != null && sender != 0) {
                    appSource = sender.getHost().Source;
                }
        
                var errorType = args.ErrorType;
                var iErrorCode = args.ErrorCode;
        
                if (errorType == "ImageError" || errorType == "MediaError") {
                    return;
                }
        
                var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\\n";
        
                errMsg += "Code: " + iErrorCode + "    \\n";
                errMsg += "Categor</x-turndown>
        
        J 1 Reply Last reply
        0
        • J JMurfey

          Hi Xenon - thanks for the response. Yes I tried setting the height and width to pixels and I do get a box that will bring up the silverlight menu when you right click inside it, but thats all. Basically, if the pages that load the sl object are in the root of my project - like the test aspx and html pages added by default when the sl project is created - it works fine. If I try and load the sl object from a page in a folder (at the same level as ClientBin) It doesn't work. even if I copy the same html or aspx pages directly from the root. I have to change a couple things -

          becomes

          and

          becomes

          (I don't think the .js is being used, so I don't think I need to do this. If I don't change the ClientBin to ..\\ClientBin, I will get a load error thrown. Do I need to set mime types or something? I read something about them only being set for the root of the project directory. I am using VS2010. Thanks! J here's the page source I get -

          Silverlight Object
          .style1
              {
                  width: 100%;
              }
          html, body {
              height: 100%;
              overflow: auto;
          }
          body {
              padding: 0;
              margin: 0;
          }
          #silverlightControlHost {
              height: 500px;
              text-align:center;
          }
          
          
          
              function onSilverlightError(sender, args) {
                  var appSource = "";
                  if (sender != null && sender != 0) {
                      appSource = sender.getHost().Source;
                  }
          
                  var errorType = args.ErrorType;
                  var iErrorCode = args.ErrorCode;
          
                  if (errorType == "ImageError" || errorType == "MediaError") {
                      return;
                  }
          
                  var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\\n";
          
                  errMsg += "Code: " + iErrorCode + "    \\n";
                  errMsg += "Categor</x-turndown>
          
          J Offline
          J Offline
          JMurfey
          wrote on last edited by
          #4

          - my own stupid mistake.

          should have been -

          it is working great now :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups