asp.net¾²Ì¬»¯htmlʱ²»Êä³ö__VIEWSTATE
protected override void Render(HtmlTextWriter writer)
{
StringWriter sw = new StringWriter();
HtmlTextWriter htmlw = new HtmlTextWriter(sw);
//°ÑÒ³ÃæÉú³ÉÄÚÈÝÄóöÀ´
base.Render(htmlw);
htmlw.Flush();
htmlw.Close();
string pageContent = sw.ToString();
string pattern=@"\<input type=""hidden"" name=""__VIEWSTATE""[^\>]*\>";
pageContent = Regex.Replace(pageContent, pattern, string.Empty, RegexOptions.IgnoreCase | RegexOptions.Multiline);
Response.Write(pageContent);
}
Ïà¹ØÎĵµ£º
¸Õ¿´µ½ÁËһƬÎÄÕ http://dotnet.csdn.net/page/a92a1213-9896-49c7-9c89-14ae5f0d87ae Ìáµ½Èçϼ¸µã:
1. Êý¾Ý¿âÁ¬½Ó³¬Ê±
2. ´´½¨µÄ¶ÔÏóÖ»¹ÜÓ㬲»¹ÜÊÍ·Å
3. µ÷ÊÔ(Debug)ģʽϱàÒëºó£¬¾ÍÓÃÓÚÓ¦Óû·¾³ÖÐÁË
4. ʵ¼Ê×÷ҵģʽ·ÖÏí
1,2,3±È½ÏºÃÀí½â£¬ÎÒÔÚ×öµÄʱºò·¸ÁËËû˵µÄ µÚÈýÖÖ´íÎó£¬ÖÁ ......
Label Web ·þÎñÆ÷¿Ø¼þ¿ÉÈÃÄúÒÔ±à³Ì·½Ê½ÉèÖà ASP.NET ÍøÒ³ÖеÄÎı¾¡£
Ò»¡¢·½°¸
ͨ³£µ±Ï£ÍûÔÚÔËÐÐʱ¸ü¸ÄÒ³ÃæÖеÄÎı¾£¨±ÈÈçÏìÓ¦°´Å¥µ¥»÷£©Ê±Ê¹Óà Label ¿Ø¼þ¡£
¶þ¡¢¹¦ÄÜ
Äú¿ÉÒÔÔÚÉè¼ÆÊ±£¬»òÕßÔÚÔËÐÐʱ´Ó³ÌÐòÖÐÉèÖà Label ¿Ø¼þµÄÎı¾¡£»¹¿ÉÒÔ½« Label ¿Ø¼þµÄ Text ÊôÐÔ° ......
ÔµØÖ·£º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 Stan ......