Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
My project is build with "componentart", and now I have to change everything into telerik, becasue we have multiple portals and they have to look alike, so I am trying to apply the same styles and animations as they look like,

when I replace the component art tools with telerik they are working fine, but when I am applying the style they used in other projects,I am receiving this error at the HostPage.aspx[dynamic]

and the error is

Microsoft JScript runtime error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException: Cannot find a Resource with the Name/Key ErrorWindowStyle [Line: 7 Position: 9]
en System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
en Brightstar.SCP.ErrorWindow.InitializeComponent()
en Brightstar.SCP.ErrorWindow..ctor(String message, String errorDetails)
en Brightstar.SCP.ErrorWindow.CreateNew(String message, String stackTrace, StackTracePolicy policy)
en Brightstar.SCP.ErrorWindow.CreateNew(Exception exception, StackTracePolicy policy)
en Brightstar.SCP.ErrorWindow.CreateNew(Exception exception)
en Brightstar.SCP.App.Application_UnhandledException(Object sender, ApplicationUnhandledExceptionEventArgs e)
en MS.Internal.Error.CallApplicationUEHandler(Exception e)
en MS.Internal.Error.GetXresultForUserException(Exception ex)


The HostPage.aspx[dynamic] file is as below

HTML
<!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">
<head id="Head1"><title>
    Brightstar Supplier Collaboration Portal
</title>
    <style type="text/css">
        html, body
        {
            height: 100%;
            overflow: hidden;
        }
        body
        {
            padding: 0;
            margin: 0;
        }
        #silverlightControlHost
        {
            height: 100%;
            text-align: center;
        }
    </style>

    <script type="text/javascript" src="Silverlight.js"></script>

    <script type="text/javascript">

        function CloseWindow() {
            window.close();
        }

        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>

    <script type="text/javascript">

        function OnSourceDownloadProgressChanged(sender, eventArgs) {

            var oSLHost = document.getElementById("silverlightControlHost");

            // get progress    
            if (eventArgs.progress)
                var progress = Math.ceil(eventArgs.progress * 100) - 1;
            else
                var progress = Math.ceil(eventArgs.get_progress() * 100) - 1;

            // update percent loaded    
            if (sender.findname("uxStatusText") != null) {
                var percentblock = sender.findName("uxStatusText");
                percentblock.Text = "Loading: " + progress.toString() + "%";

                // oImage.Opacity = eventArgs.get_progress();
                // rectBar.Width = eventArgs.progress * rectBorder.Width;
            }

         }

    </script>

</head>
<body style="height:100%;margin:0;">
    <form method="post" action="SCPHostPage.aspx" id="form1" style="height:100%;">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE4NTU4MTI5MzhkZJT0KDA5kx6yk4Q1SuJ7gKkAbhxKOg8SKs7BEXLQi1En" />
</div>


        <div id="silverlightControlHost">
                <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
            width="100%" height="100%">
            <param name="source" value="ClientBin/Brightstar.SCP.xap?-544696752" />
            <param name="splashScreenSource" value="SplashScreen.xaml" />
            <param name="onSourceDownloadProgressChanged" value="OnSourceDownloadProgressChanged" />
            <param name="onError" value="OnSilverlightError" />
            <param name="background" value="white" />
            <param id="initParams" name="initparams" value=""></param>
            <param name="minRuntimeVersion" value="4.0.50401.0" />
            <param name="uiculture" value="es" />
            <param name="culture" value="es-ES" />
            <param name="autoUpgrade" value="true" />

            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none">
                <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
                    style="border-style: none" />
            </a>
        </object>

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



Can anyone help me out with this, please, Thank you very much.
Posted

1 solution

read error message:
Quote:
Message: System.Windows.Markup.XamlParseException: Cannot find a Resource with the Name/Key ErrorWindowStyle [Line: 7 Position: 9]

It means, that in some xaml file you reference StaticResource ErrorWindowStyle, but there is no such resource in your application.
It's not about jscript or aspx page, it's about your xaml
 
Share this answer
 
v2
Comments
Member 9857060 6-Mar-13 14:31pm    
I have a ErrorWindow.xaml, and I am referring ErrorWindowStyle and I have style for that in the resources dic.
Irina Pykhova 6-Mar-13 14:36pm    
search all your xaml for ErrorWindowStyle string. Apparently, xaml loader can't find resource with this key from the place, where you reference it. For example, resource might be defined in one ResourceDictionary and referenced in another one or in xaml page. Maybe you should inlcude ResourceDictionary with this resource as a MergedDictionary in the file, where you reference it. Actually, there are many possible situations. It's hard to tell something for sure without seeing full project.
Member 9857060 6-Mar-13 14:46pm    
I found it, there is a small spell mistake,and now silverlight is loading untill 99% and is frozen, It stays there forever. do you know how to resolve this.Thank you very much
Irina Pykhova 6-Mar-13 14:54pm    
I have no ideas, it might be anything.
Member 9857060 6-Mar-13 14:55pm    
Thank you very much...I really appreciate your help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900