Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Silverlight compatibility with Dot Net NukeSilverlight compatibility with Dot Net Nuke
Previous
 
Next
New Post
10/5/2009 1:45 PM
 

Hi,

I am having a silverlight 3.0 application that I have to add to my dotnetNuke 4.05.05 web site, I created the folders and all that are required, copied the .xap file into the destop_modules folder and when I wanted to add this module to the page I got a long list of errors which said silverlight is unavailable.

Can anyone please let me know if the errors are being caused because of the versions, or should I download something else to have silverlight work?

Thanks

 
New Post
10/5/2009 3:49 PM
 

Maybe ths little module could help you.

http://dnnslmedia.codeplex.com/

Jan

 

 
New Post
10/5/2009 5:49 PM
 

 I couldn't run the application on the server, but can you please answer this question  why wouldn't the Silverlight application come up in my dotnetnuke:

This is how I tried to do it:.. I created a new usercontrol control1.ascx to the folder: ModuleName under the DestopModules folder in DNN, copied the required silverlightapplication .xap file, silverlight.js file to the folder,then added the following javascript in the 

control1.ascx file:

<script type="text/javascript" src="\\Servername\DesktopModules\ModuleName\Silverlight.js"></script>

    <script type="text/javascript">

        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 += "Category: " + errorType + "       \n";

            errMsg += "Message: " + args.ErrorMessage + "     \n";

 

            if (errorType == "ParserError") {

                errMsg += "File: " + args.xamlFile + "     \n";

                errMsg += "Line: " + args.lineNumber + "     \n";

                errMsg += "Position: " + args.charPosition + "     \n";

            }

            else if (errorType == "RuntimeError") {

                if (args.lineNumber != 0) {

                    errMsg += "Line: " + args.lineNumber + "     \n";

                    errMsg += "Position: " + args.charPosition + "     \n";

                }

                errMsg += "MethodName: " + args.methodName + "     \n";

            }

 

            throw new Error(errMsg);

        }

    </script>

   

    <div id="silverlightControlHost">

        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">

 <param name="source" value="\\Servername\DesktopModules\ModuleName\SilverlightApplicationName.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>

    
 
   Now I added this module to a page in DNN but I expected the silverlight page to popup but all I see is a blank page. 
   
  Can you please explain how would the small component you referenced possibly solve the problem I have..
 
 
Thanks,

 

 
New Post
10/5/2009 7:08 PM
 

If you install the little component as a module I refered to you will get the silverlight app to show up. (if it works)

Edit. I missed that you use DNN 4.5 the module works only in 5.x

 

 
New Post
10/5/2009 10:06 PM
 

Silverlight works great with DNN. You will find dozens of examples that all work with DNN4 at:

http://dnnsilverlight.adefwebserver.com/

An example of code to properly display your Silverlight module is:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="View.ascx.cs" Inherits="HelloWorld3.View" %>
<script type="text/javascript">
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 += "Category: " + errorType + " \n";
errMsg += "Message: " + args.ErrorMessage + " \n";

if (errorType == "ParserError") {
errMsg += "File: " + args.xamlFile + " \n";
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
else if (errorType == "RuntimeError") {
if (args.lineNumber != 0) {
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
errMsg += "MethodName: " + args.methodName + " \n";
}

throw new Error(errMsg);
}
</script>
<asp:Panel ID="silverlightControlHost" align="center" runat="server"
HorizontalAlign="Left">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
style="height: 50px; width: 500px">
<param name="source" value="<%=SilverlightApplication %>" />
<param name="onError" value="onSilverlightError" />
<param name="background" value="Transparent" />
<param name="windowless" value="true" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<param name="InitParams" value="<%=SilverlightInitParams %>" />
<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>
</
asp:Panel>

Code behind:

using System;
using DotNetNuke.Entities.Modules;

namespace HelloWorld3
{
    public partial class View : PortalModuleBase
    {
        public string SilverlightApplication { get; set; }
        public string SilverlightInitParams { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            // Register Silverlight.js file
            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "SilverlightJS",
                (this.TemplateSourceDirectory + "/Silverlight.js"));

            // Set the Web Service URL
            string strWebServiceURL = String.format(@"http://{0}{1}/{2}", 
                this.Context.Request.Url.Authority,
                this.Context.Request.ApplicationPath, 
                "DesktopModules/HelloWorld3/WebService.asmx"); 

            // Set the path to the .xap file
            SilverlightApplication = String.format("{0}{1}", TemplateSourceDirectory,
                "/ClientBin/HelloWorld3.xap");

            // Pass the Initialization Parameters to the Silverlight Control
            SilverlightInitParams = string.format("WebServiceURL={0}", strWebServiceURL);
        }
    }
}


Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Silverlight compatibility with Dot Net NukeSilverlight compatibility with Dot Net Nuke


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out