易截截图软件、单文件、免安装、纯绿色、仅160KB

解决ASP.NET下的MENU控件在IE8中不显示的问题

原地址:http://blogs.msdn.com/giorgio/archive/2009/02/01/asp-net-menu-and-ie8-rendering-white-issue.aspx
ASP.NET Menu and IE8 rendering white issue
If you are using the ASP.NET Menu control, you might encounter under certain circumstances an issue where the menu appears as a white box in IE8 Standards Mode.
What IE8 is doing IS correct (by design), in the sense that in Standards mode IE8 is following the standards. Specifically, (element).currentStyle.zIndex returns "auto" in Standards mode when zindex has not been set. The ASP.NET Menu control assumes a different value.
I’d like to suggest a few possible workarounds to solve quickly the issue (note, you can use either one of them, depending on your scenario):
Overriding the z-index property
Using CSS Friendly Control Adapters
Adding the IE7 META tag to the website
1 – Overriding the z-index property
You can manually set the z-index property of the Menu items using the DynamicMenuStyle property of the asp:Menu control (note lines 9-14 and 20). Full source code is:
1: <head runat="server">
2: <title></title>
3: <style type="text/css">
4: body
5: {
6: background-color: Silver;
7: }
8: </style>
9: <style type="text/css">
10: .IE8Fix
11: {
12: z-index: 100;
13: }
14: </style>
15: </head>
16: <body>
17: <form id="form1" runat="server">
18: <div>
19: <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
20: <DynamicMenuStyle CssClass="IE8Fix" />
21: </asp:Menu>
22: <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
23: </div>
24: </form>
25: </body>
This solution is the least intrusive, but it require a page-by-page update (unless your


相关文档:

谈ASP.NET中窗体的飘动

 本文和大家分享的是.NET中窗体的飘动。希望对大家有所帮助吧。
   用.NET制作飘动的窗体时,需要使用Timer控件。首先,当窗体加载时设定一个初始位置,然后在窗体中定义两个Timer控件,其中timer1用来控制窗体从左向右飘动,timer2控制窗体从右向左飘动,当timer1启动后,每隔0.01s,都会在触发的事件中给 ......

ASP.NET验证控件详解

 
ASP.NET
公有六种验证控件,分别如下:
 
RequiredFieldValidator
(必须字段验证) 用于检查是否有输入值
CompareValidator
(比较验证) 按设定比较两个输入
RangeValidator
(范围验证) 输入是否在指定范围
RegularExpressionValidator
(正则表达式验证) 正则表达式验证控件
CustomValid ......

ASP.NET的实用代码

1. 打开新的窗口并传送参数:

传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryStrin ......

ASP.NET中防止页面多次提交的代码实现

 Button被点击后disable掉该页面中所有的Button,从而防止提交延时导致的多次提交。基于之前的onceclickbutton脚本.
//ASP.NET中防止页面多次提交的代码:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElement;
var objs = document.getElement ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号