asp.netÒ¹»°Ö®Ê®Ò»£ºweb.configÏê½âÊÕ²Ø
ÔÚ¿ª·¢Öо³£»áÓöµ½ÕâÑùµÄÇé¿ö£¬ÔÚ²¿Êð³ÌÐòʱΪÁ˱£ÃÜÆð¼û²¢²»½«Ô´´úÂëËæÏîĿһͬ·¢²¼£¬¶øÎÒÃÇ¿ª·¢Ê±µÄ»·¾³Ó벿Êð»·¾³¿ÉÄܲ»Ò»Ö£¨±ÈÈçÊý¾Ý¿â²»Ò»Ñù£©£¬Èç¹ûÔÚ´úÂëÖб£´æÕâЩÅäÖÃÕâЩÐÅÏ¢²¿ÊðʱÐèÒªµ½Óû§ÄÇÀï¸ü¸Ä´úÂëÔÙÖØбàÒ룬ÕâÖÖ²¿Êð·½Ê½·Ç³£Âé·³¡£
ÔÚ.net ÖÐÌṩÁËÒ»ÖÖ±ã½ÝµÄ±£´æÏîÄ¿ÅäÖÃÐÅÏ¢µÄ°ì·¨£¬ÄǾÍÊÇÀûÓÃÅäÖÃÎļþ£¬ÅäÖÃÎļþµÄÎļþºó׺һ°ãÊÇ.config £¬ÔÚasp.net ÖÐÅäÖÃÎļþÃûÒ»°ãĬÈÏÊÇweb.config ¡£Ã¿¸öweb.config Îļþ¶¼ÊÇ»ùÓÚXML µÄÎı¾Îļþ£¬²¢ÇÒ¿ÉÒÔ±£´æµ½Web Ó¦ÓóÌÐòÖеÄÈκÎĿ¼ÖС£ÔÚ·¢²¼Web Ó¦ÓóÌÐòʱweb.config Îļþ²¢²»±àÒë½ødll ÎļþÖС£Èç¹û½«À´¿Í»§¶Ë·¢ÉúÁ˱仯£¬½ö½öÐèÒªÓüÇʱ¾´ò¿ªweb.config Îļþ±à¼Ïà¹ØÉèÖþͿÉÒÔÖØÐÂÕý³£Ê¹Ó㬷dz£·½±ã¡£
±¾ÆªÒª½²ÊöµÄ֪ʶÈçÏ£º
ÅäÖÃÎļþµÄ²éÕÒÓÅÏȼ¶
ÅäÖÃÎļþ½Úµã˵Ã÷
ÅäÖÃÎļþµÄ²Ù×÷
ÅäÖÃÎļþµÄ²éÕÒÓÅÏȼ¶
ÔÚ.net ÌṩÁËÒ»¸öÕë¶Ôµ±Ç°»úÆ÷µÄÅäÖÃÎļþ£¬Õâ¸öÎļþÊÇmachine.config £¬ËüλÓÚ%windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG\ ÎļþÏ£¨%windir% ÊÇϵͳ·ÖÇøϵÄϵͳĿ¼£¬ÔÚÃüÁîÐÐģʽÏÂÊäÈë%windir% È»ºó»Ø³µ¾ÍÄܲ鿴µ±Ç°»úÆ÷µÄϵͳĿ¼£¬ÔÚWindows2003 ¼°WindowsXP ÖÐ%windir% ÊÇϵͳ·ÖÇøϵÄwindows Ŀ¼£¬ÔÚWindows2000 ÖÐ%windir% ÊÇϵͳ·ÖÇøϵÄWinNT Ŀ¼£¬ÔÚ±ÊÕß»úÆ÷ÉÏÕâ¸öϵͳĿ¼ÊÇC:\WINDOWS £©¡£Õâ¸öÎļþÀïÃ涨ÒåÁËÕë¶Ôµ±Ç°»úÆ÷µÄWinForm ³ÌÐòºÍasp.net Ó¦ÓóÌÐòµÄÅäÖá£ÏÂÃæÊÇmachine.config ÎļþµÄÄÚÈÝ£º
ÔÚÕâ¸öÎļþ¼ÐÏ»¹ÓÐÒ»¸öweb.config Îļþ£¬Õâ¸öÎļþ°üº¬ÁËasp.net ÍøÕ¾µÄ³£ÓÃÅäÖá£ÏÂÃæÊÇÕâ¸öweb.config ÎļþµÄÄÚÈÝ£º
asp.net ÍøÕ¾IIS Æô¶¯µÄʱºò»á¼ÓÔØÅäÖÃÎļþÖеÄÅäÖÃÐÅÏ¢£¬È»ºó»º´æÕâЩÐÅÏ¢£¬ÕâÑù¾Í²»±Øÿ´ÎÈ¥¶ÁÈ¡ÅäÖÃÐÅÏ¢¡£ÔÚÔËÐйý³ÌÖÐasp.net Ó¦ÓóÌÐò»á¼àÊÓÅäÖÃÎļþµÄ±ä»¯Çé¿ö£¬Ò»µ©±à¼ÁËÕâЩÅäÖÃÐÅÏ¢£¬¾Í»áÖØжÁÈ¡ÕâЩÅäÖÃÐÅÏ¢²¢»º´æ¡£
µ±ÎÒÃÇÒª¶Áȡij¸ö½Úµã»òÕß½Úµã×éÐÅϢʱ£¬ÊÇ°´ÕÕÈçÏ·½Ê½ËÑË÷µÄ£º
(1) Èç¹ûÔÚµ±Ç°Ò³ÃæËùÔÚĿ¼Ï´æÔÚweb.config Îļþ£¬²é¿´ÊÇ·ñ´æÔÚËùÒª²éÕҵĽáµãÃû³Æ£¬Èç¹û´æÔÚ·µ»Ø½á¹û²¢Í£Ö¹²éÕÒ¡£
(2) Èç¹ûµ±Ç°Ò³ÃæËùÔÚĿ¼Ï²»´æÔÚweb.config Îļþ»òÕßweb.config ÎļþÖв»´æÔڸýáµãÃû£¬Ôò²éÕÒËüµÄÉϼ¶Ä¿Â¼£¬Ö±µ½ÍøÕ¾µÄ¸ùĿ¼¡£
(3) Èç¹ûÍøÕ¾¸ùĿ¼Ï²»´æÔÚweb.config Îļþ»òÕßweb.config ÎļþÖв»´æÔڸýڵãÃûÔòÔÚ%windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config
Ïà¹ØÎĵµ£º
ÔÚASP.NetÖжԸ÷¸öWebForm¿Ø¼þÒýÈëÒÔǰûÓеÄEnableViewStateÊôÐÔ¡£Õâ¸öÊôÐÔ¾¿¾¹ÓÐʲôÓá£ÎÒÃÇÖªµÀ¶ÔÓÚWebForm¶øÑÔ£¬Æä´úÂëÊÇÔÚ·þÎñÆ÷¶ËµÄ£¬ÒÔ´¦Àí¿Í»§¶ËµÄÇëÇó¡£µ±Óû§Í¨¹ýä¯ÀÀÆ÷ä¯ÀÀÍøÒ³µÄʱºò£¬»á¶ÔÍøÒ³½øÐÐijЩ²Ù×÷£¬±ÈÈç´ò¿ªÐÂÁ´½Ó£¬»òµ¥»÷ij¸ö°´Å¥¡£ÔÚASPÖУ¬ÕâЩÊÇͨ¹ý½Å±¾ÓïÑÔ¶ÔÆä½øÐд¦Àí£¬Ö®ºóÔÙ´«µÝ¸ø·þÎñÆ÷¶Ë¡ ......
ÕâÁ½¸öÊý¾ÝÀàÐÍÊÇÎÒÃÇÔÚѧϰC#ÓïÑԵĹý³ÌÖÐÊý¾Ý±È½ÏÄѵÄÁ½¸öÊý¾ÝÀàÐÍ£¬²»¹ýËûÃǺÜÖØÒª£¬ËùÒÔÓбØÒªÄóöÀ´ËµËµËûÃǵÄʹÓ÷½·¨ºÍ²»Í¬Ö®´¦£¬Ï£Íû¶ÔÄãÓÐËù°ïÖú¡£
ÏÈ×ܵÄÀ´Ëµ£º
ͨ³£ÎÒÃÇÏò·½·¨Öд«µÝµÄÊÇÖµ.·½·¨»ñµÃµÄÊÇÕâЩֵµÄÒ»¸ö¿½±´,È»ºóʹÓÃÕâЩ¿½±´,µ±·½·¨ÔËÐÐÍê±Ïºó,ÕâЩ¿½±´½«±»¶ªÆú,¶øÔÀ´µÄÖµ²»½«Êܵ½Ó°Ïì.´ËÍâÎÒÃÇ ......
1. µ±ÔÚÒ»¸ö Action ÖÐ ¶ÔÏàͬ¹¦ÄܵÄ2¸ö¿Ø¼þ½øÐи³Öµ
List<SelectListItem> WebSite = GetWebSite();
ViewData["SiteNames"] = WebSite;
if (WebSite.Count > 0)
WebSite.RemoveAt(0);
ViewData["SiteName"] = WebSite;
Ò³ÃæÏÔʾʱ»áͳһÒÔ WebSite ......
½ñÔçÓиöÍøÓÑÎʵ½ÎÒÕâÎÊÌ⣬ÒÔÇ°ÎÒ¶¼ÊÇÖ±½ÓÔÚÊý¾Ý¿âÖдæÎļþÃûµÄ£¬»¹Ã»ÓÐÊÔ¹ý´æ´¢ÕûÕÅͼƬµ½Êý¾Ý¿âÖУ¬ÉÏÍøËÑË÷ÁËһϣ¬×Ô¼ºÓÖ²âÊÔÁËÒ»·¬£¬´úÂëÈçÏ£º
½¨Á¢±£´æͼƬµÄ±íµÄSQLÓï¾ä£º
Sql´úÂë < width="14" height="15" src="javascripts/syntaxhighlighter/clipboard_new.swf" pluginspage="http://w ......