SL Content not displaying
-
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
-
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
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
-
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
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>
-
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>