asp.net ÖÐ request Óë context.requestÓÐʲôÇø±ð£¿
Request ÊôÐÔÌṩ¶Ô HttpRequest ÀàµÄÊôÐԺͷ½·¨µÄ±à³Ì·ÃÎÊ¡£ÓÉÓÚ ASP.NET Ò³°üº¬¶Ô System.Web ÃüÃû¿Õ¼ä£¨º¬ÓÐ HttpContext ÀࣩµÄĬÈÏÒýÓã¬Òò´ËÔÚ .aspx Ò³ÉÏ¿ÉÒÔÒýÓà HttpContext µÄ³ÉÔ±£¬¶ø²»ÐèÒª¶Ô HttpContext µÄÍêÈ«ÏÞ¶¨ÀàÒýÓá£ÀýÈ磬¿ÉֻʹÓà Request.Browser »ñÈ¡¿Í»§¶Ëä¯ÀÀÆ÷µÄ¹¦ÄÜ¡£µ«ÊÇ£¬Èç¹ûÒª´Ó ASP.NET ´úÂëÒþ²ØÄ£¿éÖÐʹÓà HttpRequest µÄ³ÉÔ±£¬Ôò±ØÐëÔÚ¸ÃÄ£¿éÖаüÀ¨¶Ô System.Web ÃüÃû¿Õ¼äµÄÒýÓã¬Í¬Ê±»¹ÒªÍêÈ«ÏÞ¶¨¶Ôµ±Ç°»î¶¯µÄÇëÇó/ÏìÓ¦ÉÏÏÂÎÄÒÔ¼°ÒªÊ¹ÓÃµÄ System.Web ÖеÄÀàµÄÒýÓá£ÀýÈ磬ÔÚ´úÂëÒþ²ØÒ³ÖУ¬±ØÐëÖ¸¶¨È«Ãû HttpContext.Current.Request.Browser¡£
request Óë context.request ûÓÐÇø±ð
Page Ò³ÖРʵ¼ÊÉÏÒ²ÊÇÓõ½ System.Web.HttpContext.Current.Request
Ëûµ÷Óõĺ¯ÊýÊÇ£º
public HttpRequest Request { get{return System.Web.HttpContext.Current.Request;} }
Ö»ÒªÔÚͬһ¸öÍøÕ¾ÖÐ ËûÃÇÁ½»ñÈ¡µÄÖµ¶¼ÊÇÒ»ÑùµÄ
Ïà¹ØÎĵµ£º
ÔÚ°²È«ÐÔÒªÇó²»ÊǺܸߵÄASP.Net³ÌÐòÖУ¬»ùÓÚFormsµÄÉí·ÝÑéÖ¤ÊǾ³£Ê¹ÓõÄÒ»ÖÖ·½Ê½£¬¶øÈç¹ûÐèÒª¶ÔWebService½øÐÐÉí·ÝÑéÖ¤£¬×î³£ÓõĿÉÄÜÊÇ»ùÓÚSoap ±êÍ·µÄ×Ô¶¨ÒåÉí·ÝÑéÖ¤·½Ê½¡£Èç¹û¶ÔÁ½Õß×öһϱȽϵĻ°£¬ÏÔÈ»£¬»ùÓÚFormsµÄÑéÖ¤·½Ê½¸ü¼Ó·½±ãÒ×Óã¬ÄÜ·ñ½«FormsÑéÖ¤·½Ê½Ó¦Óõ½WebServiceÖÐÈ¥ÄØ£¿
´ÓÀíÂÛÉ ......
1.ÉèÖÃweb.configÎļþ.
<system.web>
......
<globalization requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" fileEncoding="gb2312" />
......
</system.web>
»òÕߣº
aspxÎļþÖÐ:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"&g ......
΢ÈíÒѾÐû²¼ASP.NET MVC 2µÄ´úÂëÒÔMS-PLÐÒé·¢²¼,MS-PLÊÇÒ»¸öµÃµ½OSIÈÏÖ¤µÄ¿ªÔ´ÐÒ飬ASP.NET MVC»ùÓÚMS-PL·¢²¼£¬ÊÇÒ»¸öÕæÕýµÄ¿ªÔ´¿ò¼ÜÇÒûÓÐÈκÎƽ̨ÏÞÖÆ£¬Ò²¾ÍÊÇ˵£¬Äú¿ÉÒÔÔÚmonoÏÂʹÓûò¿ª·¢ASP.NET MVCµÄÏà¹ØÏîÄ¿¡£ ¿ÉÒÔµ½ASP.NET MVC 2 RTM Download Details page»ñÈ¡Ô´´úÂë,»òÕßµ½CodePlexÉÏ»ñÈ¡£¬Õâ¸öÒ³ÃæÊÇ΢Èí¹Ù ......
PHPÓëASP.NET±È½ÏµÄ¸÷¸ö·½ÃæÊÇʲôÄØ£¿PHPÓëASP.NET±È½ÏµÄ±ØÒªÐÔÊÇʲôÄØ£¿ÄÇô±¾Îľ͸øÄãÒ»¸ö´ð°¸¡£
PHPÓëASP.NET±È½ÏµÄÇ°ÑÔ£¬²»¹ÜÄãÊDz»ÊÇÒѾѡÔñÁËPHP£¬¸ù¾ÝËüÔÚÈçϱí¸ñÖÐÔÚ¼Û¸ñ¡¢Ëٶȡ¢Ð§ÂÊ¡¢°²È«ÐÔ¡¢Æ½Ì¨Ö§³ÖÐԺͿªÔ´Óë·ñÉϵıíÏÖ£¬ÎÒÃǶ¼ÄÜÅжϳöËüµÄÇ¿ÏîÊÇԶʤÓÚÈõµãµÄ¡£Î¨Ò»²»×ãµÄÊÇȱÉÙÃæÏò¶ÔÏóµÄÖ§ ......
1.//µ¯³ö¶Ô»°¿ò.µã»÷תÏòÖ¸¶¨Ò³Ãæ
Response.Write(" <script>window.alert('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡')
</script>");
Response.Write(" <script>window.location
='http://www.51aspx.com/bizpulic/upmeb.aspx' </script>");
2.//µ¯³ö¶Ô»°¿ ......