aspx 页面中的 Silverlight 对象 - 不占用整个页面空间
在我的 aspx 页面中,我正在创建两个 .在第一个面板中,我使用 aspx 菜单,在第二个面板中,添加 Silverlight 对象。但我可以看到在浏览器底部有一个高度为 100px(大约)的空白区域。为什么要添加这个空间?如何删除该空间?
提前致谢。
示例代码:
<asp:Panel ID="pnlMenu" runat="server">
<table width="100%">
<tr>
<td>
<img id="imgLogo" alt="no image" style="float:left;display:none;height:20px; width:90px;" />
</td>
<td>
<img src="sample.png" alt="no image" style="float: right" />
</td>
</tr>
<tr>
<td>
Code to add menu
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="silverlightControlHost" runat="server" ClientIDMode="Static">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
width="100%" name="silverlight1" id="SLobj" style="margin: 0px; padding: 0px;">
<param name="source" value="Sample.xap" />
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<param name="initparams" value="clientip=<%= Request.UserHostAddress %>, username=<%= HttpContext.Current.User.Identity.Name %>, StartupMode=HTML" />
<param name="minRuntimeVersion" value="4.0.50401.0" />
<param name="autoUpgrade" value="true" />
<param name="onLoad" value="SilverlightpluginLoaded" />
<param name="culture" value="<%= System.Threading.Thread.CurrentThread.CurrentCulture.Name %>" />
<param name="windowless" value="true" />
<param name="uiculture" value="<%= System.Threading.Thread.CurrentThread.CurrentUICulture.Name %>" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.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: 0; width: 0; border: 0px'>
</iframe>
</asp:Panel>
In my aspx page, i am creating two . In the first one, am using aspx menu and in second panel, adding the Silverlight object. But i can see that at the bottom of browser, there is an Empty space of height 100px(approx). Why this space getting added? How to remove that space?
Thanx in advance.
Sample code:
<asp:Panel ID="pnlMenu" runat="server">
<table width="100%">
<tr>
<td>
<img id="imgLogo" alt="no image" style="float:left;display:none;height:20px; width:90px;" />
</td>
<td>
<img src="sample.png" alt="no image" style="float: right" />
</td>
</tr>
<tr>
<td>
Code to add menu
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="silverlightControlHost" runat="server" ClientIDMode="Static">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
width="100%" name="silverlight1" id="SLobj" style="margin: 0px; padding: 0px;">
<param name="source" value="Sample.xap" />
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<param name="initparams" value="clientip=<%= Request.UserHostAddress %>, username=<%= HttpContext.Current.User.Identity.Name %>, StartupMode=HTML" />
<param name="minRuntimeVersion" value="4.0.50401.0" />
<param name="autoUpgrade" value="true" />
<param name="onLoad" value="SilverlightpluginLoaded" />
<param name="culture" value="<%= System.Threading.Thread.CurrentThread.CurrentCulture.Name %>" />
<param name="windowless" value="true" />
<param name="uiculture" value="<%= System.Threading.Thread.CurrentThread.CurrentUICulture.Name %>" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.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: 0; width: 0; border: 0px'>
</iframe>
</asp:Panel>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这些
透明的漂浮物。在表格末尾添加一个div,并将样式设置为“clear:both”
对于页面底部的iframe,去掉visibility:hidden样式并添加“display:none”
try these
Clear floats. Add a div at the end of the table and set style as "clear:both"
For the iframe at the bottom of the page, remove the visibility: hidden style and add "display:none"
我认为你必须从 silverlight 应用程序设置高度和宽度。
尝试在 Silverlight 应用程序中设置高度和宽度。
就像下面的设置页面属性一样。
VerticalAlignment="拉伸" HorizontalAlignment="拉伸"
I think you have to set Height and Width from silverlight Application.
Try to set Height and Width in Silverlight Application.
Like Set Page Property of bellow.
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
将 Height=100% 添加到对象标签。现在,它仅设置宽度。
Add Height=100% to the Object tag. Right now, it is setting only the width.