Asp.NetÏÂͨ¹ýÇл»CSS»»Æ¤·ô
Ö±½ÓÖØÐ´Renderʼþ
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
StringWriter sw = new StringWriter() ;
HtmlTextWriter htmlWriter = new HtmlTextWriter(sw) ;
base.Render(htmlWriter) ;
//µ±Ç°Óû§Ñ¡ÔñµÄ·ç¸ñcss
string css = "<link href=\"css url\" rel=\"stylesheet\" type=\"text/css\">" ;
string html = sw.ToString() ;
int startPoint = html.IndexOf("</head>", StringComparison.CurrentCultureIgnoreCase);
if (startPoint > 0)
{
html = html.Insert(startPoint, css);
}
writer.Write(html) ;
}
°ÑÕâ¸ö·ÅÔÚÿ¸öÒ³ÃæµÄ»ùÀàPageBaseÀï¡£ÄǾͷ½±ã¶àÁË¡£
µ±È»£¬Èç¹û²»ÏëÔÚÈÃÿ¸öpage¶¼¼Ì³Ð×Ô¶¨ÒåµÄ»ùÀàµÄ·½Ê½£¬ÄÇÒ²¿ÉÒÔͨ¹ýÔÚHttpModuleÀïд¡£Ò²ºÜ·½±ã.
Ò»´¦Ð´ºÃ£¬Ò³Ò³ÊÜÓÃѽ
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/21aspnet/archive/2009/02/02/3858024.aspx
Ïà¹ØÎĵµ£º
1. ÔÚXPÏ£¬IIS·¢²¼asp.net³ÌÐòʱ£¬ÓÐʱ»áÓöµ½±¨´í“µ±Ç°Óû§ÎÞ·¨·ÃÎÊIISÔªÊý¾Ý¿â”»ò“ASP.NETÓû§ÎÞ·¨·ÃÎÊÖ¸¶¨Ä¿Â¼”£¬ÎÊÌâµÄ½â¾ö·½·¨ÈçÏ£º
1.ÔÚÄãËùÐèÒª·ÃÎʵÄ×ÊԴĿ¼ÉÏÓÒ¼üÑ¡Ôñ “¹²ÏíºÍ°²È«”£¬È»ºóµã»÷“°²È«”ҳǩ¡ ......
Ö÷ÒªµÄÔÀí¾ÍÊÇÌæ»»Ä£°åÀïµÄÌØÊâ×Ö·û¡£
1¡¢¾²Ì¬Ä£°åÒ³Ãæ template.html£¬Ö÷ÒªÊǶ¨ÒåÁËÒ»Ð©ÌØÊâ×Ö·û£¬ÓÃÀ´±»Ìæ»»¡£
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> <html> <he ......
public static Boolean WriteTextFile(string content, string filepath,string name)
{
FileStream fs;
StreamWriter sw;
if (!System.IO.Directory.Exists(filepath))
{
DirectoryInfo DirInfo = Directory.CreateDirectory(filepath); //´´½¨Ä¿Â¼
DirI ......
ÕâÁ½ÌìÒòΪҪ×öÒ»¸ö¿ÉÒÔÊÕ¼¯Óû§Ìá½»ÐÅÏ¢£¬È»ºó·¢ËÍÓʼþµ½Ö¸¶¨ÓÊÏäµÄÍøÒ³¡£ÔÚ asp.net 2.0 ÀïÃæ·¢ËÍÓʼþ¿ÉÒÔʹÓà System.Net.Mail ÏÂÃæµÄÀà¡£http://www.systemnetmail.com/faq/2.1.aspx Õâ¸öµØÖ·ÓÐ System.Net.Mail µÄ×÷ÕßдµÄ·Â·ðÊÇ MSDN ÀàËÆµÄ Faq£¬¿´´úÂëµÄʱºò¿ÉÒԲο¼ÒÔÏ¡£Ê²Ã´¶¼²»ËµÁË£¬ÏÂÃæÌù³öÀ´´úÂë°É£¬±Ï¾¹´ú ......