ASP.Net ÎļþÉÏ´«´óСÏÞÖÆ½â¾ö·½°¸ÐÞ¸ÄIIS7/7.5ÅäÖÃ
IIS 7 ĬÈÏÎļþÉÏ´«´óСʱ30M
ÒªÍ»ÆÆÕâ¸öÏÞÖÆ£º
1. ÐÞ¸ÄIISµÄapplicationhost.config
´ò¿ª %windir%\system32\inetsrv\config\applicationhost.config
ÕÒµ½£º <requestFiltering>½Úµã£¬
Õâ¸ö½ÚµãĬÈÏûÓÐ <requestLimits maxAllowedContentLength="ÉÏ´«´óСµÄÖµ(µ¥Î»£ºbyte)" /> ÔªËØ£¬IIS 7ºÍIIS 7.5ÉϲâÊÔ¹ý ×î´óÖµÖ»ÄÜÊÇ<requestLimits maxAllowedContentLength="4294967295" /> <4GB,
ΪÕâ¸ö½ÚµãÐÂÔöÈçÏÂÊÂÀýÔªËØ£º<requestLimits maxAllowedContentLength="2147483647" /> £¬ÉÏ´«µÄ´óС½«¸ÄΪ2G
×¢Ò⣺ %windir%\system32\inetsrv\config\applicationhost.config ÎļþÒ»¶¨²»ÒªÓÃÆäËû»úÆ÷µÄÎļþÌæ»»£¬·ñÔòIIS½«ÎÞ·¨Æô¶¯
´ËÎļþ¼Ç¼ÁË£¬µ±Ç°IISÖÐËùÓÐSite , App poolµÄÐÅÏ¢£¬»¹ÓÐһЩÓë»úÆ÷Ïà¹ØµÄÅäÖá£
2 ÐÞ¸Äweb.config
<system.web>
<httpRuntime executionTimeout="36000" maxRequestLength="2097151"/> <!--maxRequestLength£ºÉÏ´«µÄ´óС£¬µ¥Î»K ,executionTimeout£ºÉèÖó¬Ê±Ê±¼ä£¬µ¥Î»£ºÃë¡££¨Ä¬ÈÏÊÇ90Ã룩 -->
</system.web>
×¢Ò⣺Õâ¸ömaxRequestLength×î´óÖµÖ»ÄÜÊÇ2097151K,ÉèÖôóÓÚÕâ¸öÖµ½«»á³öÏÖÈçÏ´íÎó:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The value for the property 'maxRequestLength' is not valid. The error is: The value must be inside the range 0-2097151.
Source Error:
<httpHandlers />
<customErrors mode="RemoteOnly" />
<httpRuntime executionTimeout="36000" maxRequestLength="4194304" />
<authentication mode="Windows" />
<identity impersonate="true" />
3. web.configÏÂÈç¹ûÓÐÈçϽڵã(´Ë½ÚµãÊÇΪIIS 7Éè¼ÆµÄ) £¬ÔòÐÞ¸Ä
<requestLimits maxAllowedContentLength="2147483647" /> µ¥Î»Óëapplicationhost.configÖеÄ<requestLimits maxAllowedContentLength="2147483647" /&
Ïà¹ØÎĵµ£º
Ò»¡¢ÈÏʶWeb.configÎļþ
Web.configÎļþÊÇÒ»¸öXMLÎı¾Îļþ£¬ËüÓÃÀ´´¢´æ ASP.NET Web Ó¦ÓóÌÐòµÄÅäÖÃÐÅÏ¢£¨Èç×î³£ÓõÄÉèÖÃASP.NET Web Ó¦ÓóÌÐòµÄÉí·ÝÑéÖ¤·½Ê½£©£¬Ëü¿ÉÒÔ³öÏÖÔÚÓ¦ÓóÌÐòµÄÿһ¸öĿ¼ÖС£µ±Äãͨ¹ýVB.NETн¨Ò»¸öWebÓ¦ÓóÌÐòºó£¬Ä¬ÈÏÇé¿öÏ»áÔÚ¸ùĿ¼×Ô¶¯´´½¨Ò»¸öĬÈϵÄWeb.configÎļþ£¬°üÀ¨Ä¬ÈϵÄÅäÖÃÉèÖã¬Ë ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString( ......
ÎÊ£ºÎªÊ²Ã´sessionÔÚÓÐЩ»úÆ÷ÉÏż¶û»á¶ªÊ§£¿
´ð£º¿ÉÄܺͻúÆ÷µÄ»·¾³ÓйØÏµ£¬±ÈÈ磺·À»ðǽ»òÕßɱ¶¾Èí¼þµÈ£¬³¢ÊԹرշÀ»ðǽ¡£
ÎÊ£ºÎªÊ²Ã´µ±µ÷ÓÃsession.abandonʱ²¢Ã»Óм¤·¢session_end·½·¨£¿
´ð£ºÊ×ÏÈsession_end·½·¨Ö»Ö§³Öinproc£¨½ø³ÌÄڵģ©ÀàÐ͵Äsession¡£Æä´ÎÒª¼¤·¢session_en ......
ScriptManager.RegisterStartupScript(p1, this.GetType(), "click", "alert('ok')", true);//p1ÊÇupdatepanelµÄid
ScriptManager.RegisterStartupScript(p1, this.GetType(), "click", "alert('ok')", true);//p1ÊÇupdatepanelµÄid
......