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
Ïà¹ØÎĵµ£º
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
  ......
ASP.NETÌí¼Ó¡¢Ð޸ġ¢É¾³ýweb.configÅäÖÃÐÅÏ¢
1 using System;
2 using System.Data;
3 using System.Configuration;
4 using System.Collections;
5 using Sys ......
1.ʹÓÃQueryString±äÁ¿
QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝÊý×é»ò¶ÔÏóµÄ»°£¬¾Í²»ÄÜÓÃÕâ¸ö·½·¨ÁË¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
a.aspx.csµÄC#´úÂë
view plaincopy to clip ......
Ç°¶Îʱ¼äÓÉÓÚ³ÌÐò³öÏÖÁ˱ȽϴóµÄÐÔÄÜÎÊÌ⣬ÊÓͼ£¨View£©Ö®¼äµÄÌøתËٶȷdz£Âý¡£Í¨¹ýFiddlerµ÷ÊԺͷÖÎö£¬²éÕÒµ½ÊÇÓÉÓÚÔÚÊÓͼ(View)ת»»
£¨PostBack£©¹ý³ÌÖУ¬¿Í»§¶Ë¸ø·þÎñÆ÷¶ËµÄ·¢ËÍ×Ö½ÚÊý·Ç³£´ó£¬Ò»°ãÔÚ30KÒÔÉÏ£¬¾ÍÏ൱ÓÚ¿Í»§¶Ëÿ´Î¶¼Òª¸ø·þÎñÆ÷ÉÏ´«´óÊ®KµÄÊý¾ÝÁ¿£¬ÕâÈç¹ûÊDZȽÏ
ºÃµÄÍøÂç»·¾³ÏÂÍêÈ«ÊÇ¿ÉÒÔºöÂԵģ¬µ«ÊÇÄ ......
¶ÔÓÚ¶à̬£¬»¹±ØÐèÌáÒ»¸öC#ÖеĹؼü×Ö£ºnew¡£Ç°ÃæÌáµ½£¬¶ÔÓÚvirtual·½·¨£¬JIT»áÈ·¶¨ÊµÀýµÄʵ¼ÊÀàÐÍÈ»ºó¾ö¶¨µ÷ÓÃʲô·½·¨¡£µ«ÊÇÈç¹ûÅÉÉúÀàÖÐnew¹Ø¼ü×ÖÐÞÊη½·¨£¬ÔòËüÏòCLR³ÎÇå´ËÅÉÉúÀàÖеķ½·¨Óë»ùÀàÖеķ½·¨ºÁÎÞ¹Øϵ£¬ÒÔÏ´úÂë×îÖÕµ÷ÓÃÊÇ»ùÀàµÄintroduce·½·¨£º
Code
class Program
{
static vo ......