利用C1HtmlHost嵌套页面,并且在html页面中弹出该窗口出错?
在Silverlight中嵌套页面:
<c1ext:C1HtmlHost x:Name="hTml" Width="Auto" Height="Auto" SourceUri="Default.aspx" ></c1ext:C1HtmlHost>
function OnClick_Url(s_url, from_url) { var control = document.getElementById("silverlightControl"); control.content.Page.ShowChildPage("../WebServiceUI/"+s_url); }
public void ShowChildPage(String StrUri) { Popup myPopup = new Popup(); Frame childFrame = new Frame(); myPopup.Child = childFrame; myPopup.IsOpen = true; ChildPage aChildPage = new ChildPage(myPopup, StrUri); childFrame.Content = aChildPage; myPopup.VerticalOffset = this.ActualHeight / 2 / 2 / 2 / 2 / 2; myPopup.HorizontalOffset = this.ActualWidth / 2 / 2; }
<body> <form id="form1" runat="server" style="height:100%"> <div id="silverlightControlHost"> <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="ClientBin/TestRichTestEdit.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="3.0.40624.0" /> <param name="autoUpgrade" value="true" /> <param name="windowless" value="true" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none"> <img src="http://go.microsoft.com/fwlink/?LinkId=108181" 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>