½â¾ö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
Ïà¹ØÎĵµ£º
javascript º¯Êý ºÍ CustomValidator¿Ø¼þÏà½áºÏʹÓÃ
<asp:TextBox ID="txtPwdPrompt" runat="server"></asp:TextBox>
<asp:CustomValidator id="CVPwdPrompt" runat="server" ClientValidationFunction="CheckPwd" ControlToValidate="txtPwdPrompt" ErrorMessage="<span style='font:12px'>ÌáʾÎÊÌ ......
Îå¡¢ImageMap Àà
ʹÓà ImageMap ¿Ø¼þ¿ÉÒÔ´´½¨°üº¬¶¨ÒåµÄ×÷ÓõãÇøÓòµÄͼÏñ¡£µ±Óû§µ¥»÷×÷ÓõãÇøÓòʱ£¬´Ë¿Ø¼þ¿ÉÒÔÉú³Éµ½·þÎñÆ÷µÄ»Ø·¢£¬Ò²¿ÉÒÔµ¼º½µ½Ö¸¶¨µÄ URL¡£ÀýÈ磬¿ÉÒÔʹÓô˿ؼþÏÔʾһ·ùµØÀíÇøÓòµÄµØÍ¼¡£Óû§µ¥»÷¸ÃµØÍ¼ÉϵÄÌØ¶¨ÇøÓòʱ£¬´Ë¿Ø¼þ¾Íµ¼º½µ½Ò»¸ö URL£¬¸Ã URL ÌṩÁËÑ¡¶¨ÇøÓòµ ......
Áù¡¢CircleHotSpot Àà
ÔÚ ImageMap ¿Ø¼þÖж¨ÒåÔ²ÐÎ×÷ÓõãÇøÓò¡£ÎÞ·¨¼Ì³Ð´ËÀà¡£
´ËÀàÔÚ ImageMap ¿Ø¼þÖж¨ÒåÒ»¸öÔ²ÐÎ×÷ÓõãÇøÓò¡£ÈôÒª¶¨Òå CircleHotSpot ¶ÔÏóÇøÓò£¬Ç뽫 X ÊôÐÔÉèÖÃΪ±íʾԲÐÎÇøÓòÖÐÐÄµÄ x ×ø±êµÄÖµ¡£½« Y ÊôÐÔÉèÖÃΪ±íʾԲÐÎÇøÓòÖÐÐÄµÄ y ......
use http header
protected void Page_Load(object sender, EventArgs e)
{
string format = Convert.ToString(ViewData["format"]);
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode("·ÑÓñ¨Ïú±í", Encoding.UTF8) + string.Forma ......
Label Web ·þÎñÆ÷¿Ø¼þ¿ÉÈÃÄúÒÔ±à³Ì·½Ê½ÉèÖà ASP.NET ÍøÒ³ÖеÄÎı¾¡£
Ò»¡¢·½°¸
ͨ³£µ±Ï£ÍûÔÚÔËÐÐʱ¸ü¸ÄÒ³ÃæÖеÄÎı¾£¨±ÈÈçÏìÓ¦°´Å¥µ¥»÷£©Ê±Ê¹Óà Label ¿Ø¼þ¡£
¶þ¡¢¹¦ÄÜ
Äú¿ÉÒÔÔÚÉè¼ÆÊ±£¬»òÕßÔÚÔËÐÐʱ´Ó³ÌÐòÖÐÉèÖà Label ¿Ø¼þµÄÎı¾¡£»¹¿ÉÒÔ½« Label ¿Ø¼þµÄ Text ÊôÐÔ° ......