asp.net£¨C#£©ÖÐÎÄÂÒÂëÎÊÌâ
asp.netĬÈϵıàÂëÊÇUTF-8
jsÎļþÀïµÄ±àÂëÒ²ÊÇUTF-8
µ±ÄãÒªÔÚaspxÒ³ÃæÉϽøÐд«ÖÐÎIJÎÊýʱ»á³öÏÖÂÒÂë
<-----request.aspx--½ÓÊÕ²ÎÊýÒ³----->
<----response.aspx--´«ËͲÎÊýÒ³----->
ÀýÒ»£º<a href="request.aspx?str=ÖйúÈË"></a>
½â¾ö°ì·¨Ò»£º
1.¿ÉÒԺ͸ÄwebconfigµÄ±àÂë È磺
<location path='response.aspx'>
<system.web>
<globalization fileEncoding='gb2312' requestEncoding='gb2312' responseEncoding='gb2312' culture='zh-CN'/>
</system.web>
</location>
×¢Ò⣺ÄãÒ²Òª°Ñrequest.aspxÒ³ÃæÉϵıàÂëÒ²¸Ä³ÉͬÑùµÄ,ËäÈ»ÖÐÎÄÂÒÂë½â¾öÁË£¬µ«Èç¹ûÄãÓõ½ÁËjsÎļþ¾Í»á³öÏÖÂÒÂë
//ÓÃÕâÒÔÉÏ·½·¨µÄ»°²»»á¸Ä±äÍøÕ¾µÄÆäËüÒ³ÃæÉϵıàÂë
<location path='request.aspx'>
<system.web>
<globalization fileEncoding='gb2312' requestEncoding='gb2312' responseEncoding='gb2312' culture='zh-CN'/>
</system.web>
</location>
½â¾ö°ì·¨¶þ£º
1.Èç¹ûÄã²»Ï붯webconfig Äã¿ÉÒÔÔÚ”response.aspx.cs“ÀïÃæ¶Ô²ÎÊý½øÐбàÂë È磺response.aspxÔÚÒ³ÃæÉÏ£º
<a href="request.aspx?str=<%=str%>"></a>
response.csÒ³ÃæÉÏ£º
ÉùÃ÷Ò»¸ö±äÁ¿str
public string str="ÖйúÈË";
str= HttpUtility.UrlEncode(str,System.Text.Encoding.GetEncoding("GB2312"));
//ÕâʱstrÒѾÊDZàÂëºóµÄ
2.¶øÔÚrequest.aspx.csÎļþÖÐÒ²Òª½øÐÐת»» È磺
ÉùÃ÷Ò»¸ö±äÁ¿
System.Collections.Specialized.NameValueCollection gb2312=HttpUtility.Parse
Ïà¹ØÎĵµ£º
ASP.NET »º´æ£º·½·¨ºÍ×î¼Ñʵ¼ù
2009-11-28 16:49
ÕªÒª£ºASP.NET ÌṩÈýÖÖÖ÷ÒªÐÎʽµÄ»º´æ£ºÒ³Ã漶Êä³ö»º´æ¡¢Óû§¿Ø¼þ¼¶Êä³ö»º´æ£¨»ò³ÆΪƬ¶Î»º´æ£©ºÍ»º´æ API¡£Êä³ö»º´æºÍƬ¶Î»º´æµÄÓŵãÊǷdz£Ò×ÓÚʵÏÖ£¬ÔÚ´ó¶àÊýÇé¿öÏ£¬Ê¹ÓÃÕâÁ½ÖÖ»º´æ¾Í×ã¹»ÁË¡£¶ø»º´æ API ÔòÌṩÁ˶îÍâµÄÁé»îÐÔ£¨Êµ¼ÊÉÏÊÇÏ൱´óµÄÁé»îÐÔ£©£¬¿ÉÓÃÓÚÔÚÓ¦Ó ......
1. Ò³ÇëÇó£º
Ò³ÇëÇó·¢ÉúÔÚÒ³ÉúÃüÖÜÆÚ¿ªÊ¼Ö®Ç°¡£Óû§ÇëÇóҳʱ£¬ASP.NET ½«È·¶¨ÊÇ·ñÐèÒª·ÖÎöºÍ±àÒëÒ³£¨´Ó¶ø¿ªÊ¼Ò³µÄÉúÃüÖÜÆÚ£©£¬»òÕßÊÇ·ñ¿ÉÒÔÔÚ²»ÔËÐÐÒ³µÄÇé¿öÏ·¢ËÍÒ³µÄ»º´æ°æ±¾ÒÔ½øÐÐÏìÓ¦¡£
2. ¿ªÊ¼£º
ÔÚ¿ªÊ¼½× ......
Ç°¶Îʱ¼äÓÉÓÚ³ÌÐò³öÏÖÁ˱ȽϴóµÄÐÔÄÜÎÊÌ⣬ÊÓͼ£¨View£©Ö®¼äµÄÌøתËٶȷdz£Âý¡£Í¨¹ýFiddlerµ÷ÊԺͷÖÎö£¬²éÕÒµ½ÊÇÓÉÓÚÔÚÊÓͼ(View)ת»»
£¨PostBack£©¹ý³ÌÖУ¬¿Í»§¶Ë¸ø·þÎñÆ÷¶ËµÄ·¢ËÍ×Ö½ÚÊý·Ç³£´ó£¬Ò»°ãÔÚ30KÒÔÉÏ£¬¾ÍÏ൱ÓÚ¿Í»§¶Ëÿ´Î¶¼Òª¸ø·þÎñÆ÷ÉÏ´«´óÊ®KµÄÊý¾ÝÁ¿£¬ÕâÈç¹ûÊDZȽÏ
ºÃµÄÍøÂç»·¾³ÏÂÍêÈ«ÊÇ¿ÉÒÔºöÂԵģ¬µ«ÊÇÄ ......
C#»Ï߿ؼþµÄÓ¦ÓÃʵÀý½éÉÜ֮ǰÎÒÃÇÒªÃ÷°×ÔÚC#ÖÐûÓлÏߵĿؼþ£¬ÕâÀïдÁËÒ»¸ö£¬´ó¼Ò·ÖÏí¡£¹²ÓÐÁ½¸ö¿Ø¼þ·Ö±ðÊÇ»ºáÏߺͻÊúÏߵģ¬¹ØÓÚÔõô»Ð±ÏßÓÐÐËȤµÄ¿ÉÒÔ×öÒ»¸ö´ó¼Ò·ÖÏí¡£
C#»Ï߿ؼþÖ®ºáÏß
using System;
using System.Collections;
using System.ComponentModel; ......