ASP.NETÒ³Ãæ´«Êý¾ÝµÄ¸÷ÖÖ·½·¨ºÍ·ÖÎö
WebÒ³ÃæÊÇÎÞ״̬µÄ£¬ ·þÎñÆ÷¶Ôÿһ´ÎÇëÇó¶¼ÈÏΪÀ´×Ô²»Í¬Óû§£¬Òò´Ë£¬±äÁ¿µÄ״̬ÔÚÁ¬Ðø¶ÔͬһҳÃæµÄ¶à´ÎÇëÇóÖ®¼ä»òÔÚÒ³ÃæÌøתʱ²»»á±»±£Áô¡£ÔÚÓÃASP.NET Éè¼Æ¿ª·¢Ò»¸öWebϵͳʱ£¬ Óöµ½Ò»¸öÖØÒªµÄÎÊÌâÊÇÈçºÎ±£Ö¤Êý¾ÝÔÚÒ³Ãæ¼ä½øÐÐÕýÈ·¡¢°²È«ºÍ¸ßЧµØ´«ËÍ£¬Asp.net ÌṩÁË״̬¹ÜÀíµÈ¶àÖÖ¼¼ÊõÀ´½â¾ö±£´æºÍ´«µÝÊý¾ÝÎÊÌ⣬ÒÔÏÂÀ´Ì½ÌÖ.NET ϵĽâ¾ö´ËÎÊÌâµÄ¸÷ÖÖ·½·¨ºÍ¸÷×ÔµÄÊÊÓó¡ºÏ¡£
1.1 ʹÓÃQuerystring ·½·¨
QueryString Ò²½Ð²éѯ×Ö·û´®£¬ ÕâÖÖ·½·¨½«Òª´«µÝµÄÊý¾Ý¸½¼ÓÔÚÍøÒ³µØÖ·(URL)ºóÃæ½øÐд«µÝ¡£ÈçÒ³ÃæA.aspx Ìøתµ½Ò³ÃæB.aspx£¬¿ÉÒÔÓÃRequest.Redirect("B.aspx?²ÎÊýÃû³Æ=²ÎÊýÖµ")·½·¨£¬Ò²¿ÉÒÔÓó¬Á´½Ó£º£¬Ò³ÃæÌøתºó£¬ÔÚÄ¿±êÒ³ÃæÖпÉÓÃRuquest["²ÎÊýÃû³Æ"]À´½ÓÊÕ²ÎÊý¡£Ê¹ÓÃQuerySting ·½·¨µÄÓŵãÊÇʵÏÖ¼òµ¥£¬ ²»Ê¹Ó÷þÎñÆ÷×ÊÔ´£»È±µãÊÇ´«µÝµÄÖµ»áÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÉÏ£¬Óб»´Û¸ÄµÄ·çÏÕ£¬²»ÄÜ´«µÝ¶ÔÏó£¬Ö»ÓÐÔÚͨ¹ýURL ÇëÇóҳʱ²éѯ×Ö·û´®²ÅÊÇ¿ÉÐеġ£
1.2 ÀûÓÃÒþ²ØÓò
Òþ²ØÓò²»»áÏÔʾÔÚÓû§µÄä¯ÀÀÆ÷ÖУ¬ Ò»°ãÊÇÔÚÒ³ÃæÖмÓÈëÒ»¸öÒþ²Ø¿Ø¼þ£¬ Óë·þÎñÆ÷½øÐн»»¥Ê±°ÑÖµ¸³¸øÒþ²Ø¿Ø¼þ²¢Ìá½»¸øÏÂÒ»Ò³Ãæ¡£Òþ²ØÓò¿ÉÒÔÊÇÈκδ洢ÔÚÍøÒ³ÖеÄÓëÍøÒ³ÓйصÄÐÅÏ¢µÄ´æ´¢¿â¡£Ê¹ÓÃÒþ²ØÓò´æÈëÊýֵʱÓãºhidden ¿Ø¼þ.value=ÊýÖµ£¬È¡³ö½ÓÊÕÊýֵʱÓ㺱äÁ¿=hidden ¿Ø¼þ.value¡£Ê¹ÓÃÒþ²ØÓòµÄÓŵãÊÇʵÏÖ¼òµ¥£¬ Òþ²ØÓòÊDZê×¼µÄHTML ¿Ø¼þ£¬²»ÐèÒª¸´Ôӵıà³ÌÂß¼¡£Òþ²ØÓòÔÚÒ³ÉÏ´æ´¢ºÍ¶ÁÈ¡£¬²»ÐèÒªÈκηþÎñÆ÷×ÊÔ´£¬¼¸ºõËùÓÐä¯ÀÀÆ÷ºÍ¿Í»§¶ËÉ豸¶¼Ö§³Ö¾ßÓÐÒþ²ØÓòµÄ´°Ì塣ȱµãÊÇ´æ´¢½á¹¹ÉÙ£¬½ö½öÖ§³Ö¼òµ¥µÄÊý¾Ý½á¹¹£¬´æ´¢Á¿ÉÙ£¬ÒòΪËü±»´æ´¢ÔÚÒ³Ãæ±¾Éí£¬ËùÒÔÎÞ·¨´æ´¢½Ï´óµÄÖµ£¬¶øÇÒ´óµÄÊý¾ÝÁ¿»áÊܵ½·À»ðǽºÍ´úÀíµÄ×èÖ¹¡£
1.3 ViewState
ViewState ÊÇÓÉASP.NET Ò³Ãæ¿ò¼Ü¹ÜÀíµÄÒ»¸öÒþ²ØµÄ´°Ìå×ֶΡ£µ±ASP.NET Ö´ÐÐij¸öÒ³Ãæʱ£¬¸ÃÒ³ÃæÉϵÄViewState ÖµºÍËùÓпؼþ½«±»ÊÕ¼¯²¢¸ñʽ»¯³ÉÒ»¸ö±àÂë×Ö·û´®£¬ È»ºó±»·ÖÅä¸øÒþ²Ø´°Ìå×ֶεÄÖµÊôÐÔ¡£Ê¹ÓÃViewState ´«µÝÊý¾Ýʱ¿ÉÓãºViewState [" ±äÁ¿Ãû"]=ÊýÖµ£¬ÔÚÈ¡³öÊý¾ÝʱÓ㺱äÁ¿=ViewState["±äÁ¿Ãû"]¡£Ê¹ÓÃViewState µÄÓŵãÊÇ£ºÔÚ¶ÔͬһҳµÄ¶à¸öÇëÇó¼ä×Ô¶¯±£ÁôÖµ£¬²»Ó÷þÎñÆ÷¶Ë×ÊÔ´£¬ÊµÏÖ¼òµ¥£¬ÊÓͼ״̬ÖеÄÖµ¾¹ý¹þÏ£¼ÆËãºÍѹËõ£¬²¢ÇÒÕë¶ÔUnicode&
Ïà¹ØÎĵµ£º
ValidationSummary:¸Ã¿Õ¼äµÄ×÷ÓÃÊÇ°ÑËùÓÐÑéÖ¤´íÎóµÄÁбíÏÔʾÔÚÒ³ÃæµÄͬһ¸öµØ·½¡£
ÊôÐÔ£ºDisplayMode:ÏÔʾ´íÎóÐÅÏ¢µÄ·½Ê½£ºBulletList·ÅÔÚ<ul><li></li></ul>ÀList·ÅÔÚ<div>´íÎó1<br/>´íÎó2</div>ÖУ¬²»Í¬ÐÅϢʹÓÃ<br/>¸ô¿ª£»SingleParagraph·ÅÔÚ<div>& ......
ÔÚʹÓÃasp.net±àдwebserviceʱ£¬Ä¬ÈÏÇé¿öÏÂÊDz»Ö§³ÖsessionµÄ£¬µ«ÎÒÃÇ¿ÉÒÔ°ÑWebMethodµÄEnableSessionÑ¡ÏîÉèΪtrueÀ´ÏÔʽµÄ´ò¿ªËü£¬Çë¿´ÒÔÏÂÀý×Ó£º
1 н¨ÍøÕ¾WebSite
2 н¨web·þÎñWebService.asmx£¬Ëü¾ßÓÐÒÔÏÂÁ½¸ö·½·¨£º
C#-Code:
[WebMethod(EnableSession = true)]
public string Login( ......
< align=middle src=http://player.youku.com/player.php/sid/XMTQ3NTE2NzIw/v.swf width=480 height=400 type=application/x-shockwave-flash allowScriptAccess="sameDomain" quality="high" mce_src="http://player.youku.com/player.php/sid/XMTQ3NTE2NzIw/v.swf"> ......
Asp.netµÄÉí·ÝÑéÖ¤ÓÐÓÐÈýÖÖ£¬·Ö±ðÊÇ"Windows | Forms | Passport"£¬ÆäÖÐÓÖÒÔFormsÑéÖ¤ÓõÄ×î¶à£¬Ò²×îÁé»î¡£
Forms ÑéÖ¤·½Ê½¶Ô»ùÓÚÓû§µÄÑéÖ¤ÊÚȨÌṩÁ˺ܺõÄÖ§³Ö£¬¿ÉÒÔͨ¹ýÒ»¸öµÇ¼ҳÃæÑéÖ¤Óû§µÄÉí·Ý£¬½«´ËÓû§µÄÉí·Ý·¢»Øµ½¿Í»§¶ËµÄCookie£¬Ö®ºó´ËÓû§ÔÙ·ÃÎÊÕâ¸öwebÓ¦ÓþͻáÁ¬Í¬Õâ¸öÉí·ÝCookieÒ»Æð·¢Ë͵½·þÎñ¶ ......