当前位置: 代码迷 >> Silverlight >> 超链接跳转有关问题
  详细解决方案

超链接跳转有关问题

热度:9659   发布时间:2013-02-26 00:00:00.0
超链接跳转问题
刚接触sliverlight,超链接遇见了问题,希望各位大神能帮忙看下,具体如下:
我在app.xmal里面添加了
     <Border x:Name="ContentBorder" >
            <navigation:Frame x:Name="ContentFrame">
                <navigation:Frame.UriMapper>
                  <uriMapper:UriMapper>
                    <uriMapper:UriMapping Uri="" MappedUri="/MainPage.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/test/{pageName}.xaml"/>
                  </uriMapper:UriMapper>
                </navigation:Frame.UriMapper>
            </navigation:Frame>
        </Border>

然后在一个系统生成的MainPage.xaml里面添加一个超链接按钮
<HyperlinkButton Content="test" Width="34" Foreground="Black" FontSize="13.333" FontWeight="Bold" NavigateUri="/testPage" TargetName="ContentFrame"/>

但是这样跳转的时候就说找不到指定的路径,网页里面显示的uri是http://localhost:3231/testPage
然后我修改超链接按钮的值,把引导地址改为
<HyperlinkButton Content="test" Width="34" Foreground="Black" FontSize="13.333" FontWeight="Bold" NavigateUri="/test/testPage.xaml"/>
但是结果还是不行,这时候网页里面显示的uri是http://localhost:3231/test/testPage.xaml


具体提示的错误如下:
无法找到资源。

说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。 

请求的 URL: /test/testPage.xaml

弄了好几天,都没能解决,希望各位大神帮帮忙……先谢谢了



------解决方案--------------------------------------------------------
楼主可以参考:
http://www.cnblogs.com/chengxingliang/archive/2011/05/05/2036861
  相关解决方案