您好我的Silverlight导航应用程序有问题(使用Silverlight 4,.NET 4,MS VisualStudio 2010) 我已经使用MainPage创建了导航应用程序和两个页面 - Home adn About。 主页代码仅在下面修改。
当我运行项目时,我收到错误“遇到未知错误。请与管理员联系以获取更多信息。错误详情:找不到页面:”/ Home“”
怎么了?? :(
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();
}
}
}
答案 0 :(得分:0)
我认为在Visual Studio 2010和Internet Explorer 9中将Silverlight导航应用程序与SOAP Web服务一起使用时,这是一个错误。与Visual Studio开发服务器Cassini有关,或者看起来如此。解决方法是避免使用导航应用模板。