Silverlight 4 Out of Browser failing on navigation service

wint100
wint100 used Ask the Experts™
on
I have my SL4 in-browser app all working, and most of the OOB part works well, including Ria and WCF services.

The problem I get is when I try to navigate from code behind, an exception is thrown:

   at System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult)
   at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)
Caused by: [Arg_TargetInvocationException]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50524.0&File=mscorlib.dll&Key=Arg_TargetInvocationException

   at System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult)
   at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)




The code is shown below, is this usable for OOB?
if (app.selectedReport == "Annual")
                    {
                        this.NavigationService.Navigate(new Uri("/AnnualEnergy", UriKind.Relative));
                    }
                    if (app.selectedReport == "Monthly")
                    {
                        this.NavigationService.Navigate(new Uri("/MonthlyEnergy", UriKind.Relative));
                    }
                    if (app.selectedReport == "Weekly")
                    {
                        this.NavigationService.Navigate(new Uri("/WeeklyEnergy", UriKind.Relative));
                    }
                    if (app.selectedReport == "Daily")
                    {
                        this.NavigationService.Navigate(new Uri("/DailyEnergy", UriKind.Relative));
                    }
                    if (app.selectedReport == "MIC")
                    {
                        this.NavigationService.Navigate(new Uri("/MaximumImportCapacity", UriKind.Relative));
                    }
                    if (app.selectedReport == "Estimate")
                    {
                        this.NavigationService.Navigate(new Uri("/ElecBillEstimate", UriKind.Relative));
                    }

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
have you tried
this.NavigationService.Navigate(new Uri("/AnnualEnergy.xaml", UriKind.Relative));
Commented:
Hi,

this turned out to be a problem when trying to read the Page width as follows, into a Var instead of parsing to an Int32:

HtmlPage.Window.Eval("screen.width").ToString()

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial