Silverlight 4.0 从aspx重定向到silverlight xaml

Silverlight 4.0 从aspx重定向到silverlight xaml,silverlight-4.0,Silverlight 4.0,从aspx重定向到silverlight xamlPage我正在使用siverlight应用程序 我正在使用以下代码 导航(新Uri(“/View/Pages/ActiveTaskPage.xaml”,UriKind.Absolute)) 它不起作用了 有人能帮我吗?您可以在新的aspx页面中创建silverlight应用程序,并提供指向silverlight应用程序所在的aspx页面的链接 使用此链接:Silverlight 4附带了在ASP.NET中不可能实现的工具、控件和功能。各公司已经在

从aspx重定向到silverlight xamlPage我正在使用siverlight应用程序

我正在使用以下代码 导航(新Uri(“/View/Pages/ActiveTaskPage.xaml”,UriKind.Absolute))

它不起作用了


有人能帮我吗?

您可以在新的aspx页面中创建silverlight应用程序,并提供指向silverlight应用程序所在的aspx页面的链接


使用此链接:

Silverlight 4附带了在ASP.NET中不可能实现的工具、控件和功能。各公司已经在建造超酷的Silverlight控件。目前,我正在一个网站上工作,我们必须构建一些Silverlight自定义控件,并将这些控件与ASP.NET 4.0应用程序集成

本文介绍如何在ASP.NET应用程序中集成和托管Silverlight控件

首先,让我们制作一个新的Silverlight项目,并在其中放入您喜欢的内容;您可以使用我的代码进行测试

这是我的
MainPage.xaml

<UserControl x:Class="SLTestExample.MainPage"
    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"
    mc:Ignorable="d"
     xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    <Grid x:Name="LayoutRoot" Background="White" Margin="-146,-105,-145,-109" Height="500" Width="800">
        <sdk:DatePicker Height="23" HorizontalAlignment="Left" Margin="183,159,0,0" Name="datePicker1" VerticalAlignment="Top" Width="120" />
        <sdk:Calendar Margin="312,149,200,73" d:LayoutOverrides="Width"/>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Welcome Raj Kumar" VerticalAlignment="Top" Margin="179,125,0,0" Width="158" Foreground="#FFC82C2C" FontWeight="Bold" FontStyle="Italic" FontSize="13.333"/>
        <Rectangle Fill="#FF9B9BC2" Height="100" Stroke="Black" VerticalAlignment="Top"/>
        <Rectangle Fill="#FF83A16B" Height="30" Stroke="Black" VerticalAlignment="Bottom"/>
        <Rectangle Fill="#FFC2AF9B" HorizontalAlignment="Left" Stroke="Black" Width="175" Margin="0,104,0,34"/>
        <Rectangle Fill="#FF747370" HorizontalAlignment="Right" Stroke="Black" Width="186" Margin="0,104,0,34"/>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="This is header" VerticalAlignment="Top" Margin="63,11,0,0" Width="263" FontSize="24" FontWeight="Bold" FontStyle="Italic"/>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="This is footer" VerticalAlignment="Bottom" Margin="60,0,0,7" Width="263" FontSize="13.333" Foreground="#FFE5EFEF"/>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="This is left bar" VerticalAlignment="Top" Margin="8,106,0,0" Width="157" FontSize="13.333" Foreground="#FFE5EFEF"/>
        <TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="This is right bar" VerticalAlignment="Top" Margin="0,106,18,0" Width="157" FontSize="13.333" Foreground="#FFE5EFEF"/>
    </Grid>
</UserControl>

现在只需运行应用程序即可查看结果。及

现在将此代码放到.aspx页面

<body>
    <form id="form1" runat="server">
    <div id="silverlightControlHost">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
          <param name="source" value="ClientBin/SLTestExample.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="background" value="white" />
          <param name="minRuntimeVersion" value="3.0.40818.0" />
          <param name="autoUpgrade" value="true" />
          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&;v=3.0.40818.0"  style="text-decoration:none">
                   <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
    </form>
</body>

为什么要尝试重定向xaml文件。。只需调用.XAP文件对象。。它将显示.XAML文件内容。。