2
votes

Hello i have problem with Silverlight Navigation application (Using Silverlight 4, .NET 4, MS VisualStudio 2010) I have created Navigation Application with MainPage and two pages - Home adn About. Only modification is in Home page code is bellow.

When i run project i get error "An unknown error was encountered. Please contact your administrator for more information. Error details: Page not found: "/Home" "

What's wrong???? :(


Home.xaml

<navigation:Page xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="Nav.Home" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
Title="Home"
Style="{StaticResource PageStyle}">
    <Grid x:Name="LayoutRoot">
        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}"></ScrollViewer>
        <StackPanel x:Name="ContentStackPanel" Background="{x:Null}" Margin="0,0,0,-28">
            <Slider Height="16" Name="sliderVariableCount" Width="300" Minimum="2" Maximum="8" SmallChange="1" ValueChanged="sliderVariableCount_ValueChanged" />
            <TextBox Height="53" Name="tbDump" Width="432" />
        </StackPanel>
    </Grid>
</navigation:Page>

Home.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Nav
{
    public partial class Home : Page
    {
        public Home()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void sliderVariableCount_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            tbDump.Text = sliderVariableCount.Value.ToString();
        }
    }
}
1
Post your code which calls the navigation service. I think you need to use the full class name rather than just Home but can't be sure as silverlight navigation and Prism navigation tie me up in knots. - BenCr
in MainPage - is link by default: <HyperlinkButton x:Name="Link1" Style="{StaticResource LinkStyle}" NavigateUri="/Home" TargetName="ContentFrame" Content="home"/> - Tom
Actiually I assume you're browser is pointing to a uri something like localhost/Default.aspx#/Home try adding a trailing slash localhost/Default.aspx#/Home - BenCr
SO removed the trailing slash from my example /Home/ - BenCr
URL localhost:5303/NavTestPage.aspx#/About is ok and working and both (localhost:5303/NavTestPage.aspx#/Home and localhost:5303/NavTestPage.aspx) is not working. I assume that problem is with slider when i delete "ValueChanged="sliderVariableCount_ValueChanged" " it is ok - Tom

1 Answers

0
votes

I believe this is a bug when using Silverlight Navigation application with a SOAP web service in Visual Studio 2010 and Internet Explorer 9. Something to do with Visual Studio Development server Cassini, or so it seems. A workaround is to avoid the Navigation app template.