易截截图软件、单文件、免安装、纯绿色、仅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实现在线人数统计

 
利用Application对象和Session对象可以统计当前在线用户数量.
注意:
(1)在会话开始和结束时,一定要进行加锁和解锁操作。由于多个用户可以共享Application对象,因此加锁是必要的,这样可以保证在同一时
刻只有一个客户可以修改和存取Application对象的属性。如果加锁后,迟迟不给开锁,会导致用户无法访问Applic ......

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

      Localize Web 服务器控件使您可以在页的特定区域中显示本地化后的文本。
 
一、背景
Localize 控件与 Literal Web 服务器控件完全相同,并与 Label Web 服务器控件相似。虽然 Label 控件可让您向显示的文本应用样式,但 Localize 控件不允许这样做。通过设置从 Literal 控件继承的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号