Silverlight 未在导航上呈现
我正在尝试创建一个需要登录的网站。它完全采用银光设计。所以我的第一个页面 home.xaml 加载到 mysite.aspx 中,它基本上有一个登录页面。登录后,用户被重定向到另一个页面user.aspx。在该页面中,我嵌入了另一个名为 nav.xaml 的 silverlight 控件。
所以现在当 user.aspx 加载时,它应该加载 silverlight 控件。我已经对app.xaml.vb进行了编程,以便当请求的页面是user.aspx时,它会在根布局中加载nav.xaml。但由于某种原因它不起作用。我的app.xaml.vb代码:
Private Sub Application_Startup(ByVal o As Object, ByVal e As StartupEventArgs) Handles Me.Startup
If e.InitParams.ContainsKey("ReqPage") Then
If e.InitParams("ReqPage") = "userpage" Then
Me.RootVisual = New Nav()
End If
Else
Me.RootVisual = New Home()
End If
End Sub
在IE中,一半的nav.xaml被渲染。但在 Firefox 中什么也没有呈现。那么究竟发生了什么?请帮忙!
I'm trying to create a site that requires login. Its entirely designed in silverlight. So my first page, home.xaml loads in mysite.aspx and it basically has a login page. AFter login, the user is redirected to another page user.aspx. in that page, i've embedded another silverlight control called nav.xaml.
so now when user.aspx loads it is supposed to load a silverlight control. i've programmed app.xaml.vb such that it loads nav.xaml in the rootlayout when the page requesting is user.aspx. but for some reason its not working. my app.xaml.vb code:
Private Sub Application_Startup(ByVal o As Object, ByVal e As StartupEventArgs) Handles Me.Startup
If e.InitParams.ContainsKey("ReqPage") Then
If e.InitParams("ReqPage") = "userpage" Then
Me.RootVisual = New Nav()
End If
Else
Me.RootVisual = New Home()
End If
End Sub
in IE, half of the nav.xaml is rendered. but in firefox nothing is rendered. so wats going on exactly? pls help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
得到了解决方案。当控件的 height 属性设置为“100%”时,其高度属性设置为 0。我不知道当它尝试自动调整大小时可能有什么东西被搞砸了。通过手动指定 silverlight 控件的高度(以 px 为单位)来解决这个问题。
注意 div 标签中的 height 属性。现在它可以在 IE 和 Firefox 中运行。
got the solution. the control's height property is set to 0 when its set as "100%". i dont know may be something is screwed when it tries to automatically size. Got around it by manually specifying the height of the silverlight control in px.
notice the height attribute in the div tag. now its working both in IE and firefox.