ASP.NET
ÊÓͼ״̬ÊÇ ASP.NET Ò³¿ò¼ÜÓÃÓÚÔÚÍù·µ¹ý³ÌÖ®¼ä±£ÁôÒ³ºÍ¿Ø¼þÖµµÄ·½·¨¡£ÔÚ³ÊÏÖÒ³µÄ HTML ±ê¼Çʱ£¬±ØÐëÔڻط¢¹ý³ÌÖб£ÁôµÄÒ³ºÍÖµµÄµ±Ç°×´Ì¬½«±»ÐòÁл¯Îª Base64 ±àÂë×Ö·û´®¡£È»ºó£¬´ËÐÅÏ¢½«±»·ÅÈëÒ»¸ö»ò¶à¸öÊÓͼ״̬Òþ²Ø×ֶΡ£
1¡¢·½°¸
ÊÓͼ״̬ÓÉ ASP.NET Ò³¿ò¼Ü×Ô¶¯ÓÃÓÚ±£´æÔÚ¸÷¸ö»Ø·¢Ö®¼ä±ØÐë±£ÁôµÄÐÅÏ¢¡£´ËÐÅÏ¢°üÀ¨¿Ø¼þµÄÈκηÇĬÈÏÖµ¡£
Äú»¹¿ÉÒÔʹÓÃÊÓͼ״̬À´´æ´¢Ìض¨ÓÚÒ³µÄÓ¦ÓóÌÐòÊý¾Ý¡£
2¡¢¹¦ÄÜ
ÊÓͼ״̬ÊÇ ASP.NET Ò³ÖеĴ洢¿â£¬¿ÉÒÔ´æ´¢±ØÐëÔڻط¢¹ý³ÌÖб£ÁôµÄÖµ¡£Ò³¿ò¼ÜʹÓÃÊÓͼ״̬ÔÚ¸÷¸ö»Ø·¢Ö®¼ä±£´æ¿Ø¼þÉèÖá£
¿ÉÒÔÔÚÄú×Ô¼ºµÄÓ¦ÓóÌÐòÖÐʹÓÃÊÓͼ״̬Íê³ÉÒÔϹ¤×÷£º
·ÔÚ¸÷¸ö»Ø·¢Ö®¼ä±£´æÖµ£¬¶ø²»½«ÕâЩֵ´æ´¢ÔڻỰ״̬»òÓû§ÅäÖÃÎļþÖС£
·´æ´¢Äú¶¨ÒåµÄÒ³»ò¿Ø¼þÊôÐÔµÄÖµ¡£
·´´½¨Ò»¸ö×Ô¶¨ÒåÊÓͼ״̬Ìṩ³ÌÐò£¬ÒԱ㽫ÊÓͼ״̬ÐÅÏ¢´æ´¢ÔÚ SQL Server Êý¾Ý¿â»òÆäËûÊý¾Ý´æ´¢ÇøÖС£
ÀýÈ磬Äú¿ÉÒÔ½«ÐÅÏ¢´æ´¢ÔÚÊÓͼ״̬ÖУ¬ÕâÑùÔÚÏ´ν«¸ÃÒ³·¢Ë͵½·þÎñÆ÷ʱ£¬´úÂë±ã¿ÉÒÔÔÚÒ³¼ÓÔØʼþ¹ý³ÌÖзÃÎÊÕâЩÐÅÏ¢¡£
3¡¢±³¾°
Web Ó¦ÓóÌÐòÊÇÎÞ״̬µÄ¡£Ã¿´Î´Ó·þÎñÆ÷ÇëÇóҳʱ£¬¶¼»á´´½¨ÍøÒ³ÀàµÄÒ»¸öÐÂʵÀý¡£Õâͨ³£Òâζ×ÅÔÚÿ´ÎÍù·µ¹ý³ÌÖлᶪʧ¸ÃÒ³¼°Æä¿Ø¼þÖеÄËùÓÐÐÅÏ¢¡£ÀýÈ磬ĬÈÏ״̬Ï£¬Èç¹ûÓû§½«ÐÅÏ¢ÊäÈëµ½ HTML ÍøÒ³ÉϵÄÎı¾¿òÖУ¬¸ÃÐÅÏ¢»á·¢Ë͵½·þÎñÆ÷¡£µ«ÊÇ£¬¸ÃÐÅÏ¢²»»áÔÚÏìÓ¦Öзµ»Øµ½ä¯ÀÀÆ÷¡£
ΪÁË¿Ë·þ Web ±à³ÌµÄÕâÒ»¹ÌÓеľÖÏÞÐÔ£¬ASP.NET Ò³¿ò¼Ü°üº¬¼¸ÖÖ״̬¹ÜÀí¹¦ÄÜ£¬¿ÉÒÔÔÚÍù·µ¹ý³ÌÖ®¼ä½«Ò³ºÍ¿Ø¼þÖµ±£´æµ½ Web ·þÎñÆ÷¡£ÆäÖÐÒ»ÖÖ¹¦ÄܱãÊÇÊÓͼ״̬¡£
ĬÈÏÇé¿öÏ£¬ASP.NET Ò³¿ò¼ÜʹÓÃÊÓͼ״̬ÔÚÍù·µ¹ý³ÌÖ®¼ä±£´æÒ³ºÍ¿Ø¼þÖµ¡£ÔÚ³ÊÏÖÒ³µÄ HTML ʱ£¬±ØÐëÔڻط¢¹ý³ÌÖб£ÁôµÄÒ³ºÍÖµµÄµ±Ç°×´Ì¬½«±»ÐòÁл¯Îª Base64 ±àÂë×Ö·û´®¡£È»ºó£¬ËüÃǽ«±»·ÅÈëÒ³ÖеÄÒ»¸ö»ò¶à¸öÒþ²Ø×ֶΡ£
Äú¿ÉÒÔÔÚ´úÂëÖÐʹÓÃÒ³µÄ ViewState ÊôÐÔ·ÃÎÊÊÓͼ״̬¡£ViewState ÊôÐÔÊÇÒ»¸ö°üº¬¼ü/Öµ¶Ô£¨ÆäÖаüº¬ÊÓͼ״̬Êý¾Ý£©µÄ×ֵ䡣
°²È«ËµÃ÷£º ¶ñÒâÓû§¿ÉÒÔºÜÈÝÒ׵ز鿴ºÍÐÞ¸ÄÒþ²ØÓòµÄÄÚÈÝ¡£
ͨ¹ýʵÏÖ×Ô¶¨ÒåµÄ PageStatePersister ÀàÒÔ´æ´¢Ò³Êý¾Ý£¬Äú¿ÉÒÔ¸ü¸ÄĬÈÏÐÐΪ²¢½«ÊÓͼ״̬´æ´¢µ½ÁíÒ»¸öλÖã¨Èç SQL Server Êý¾Ý¿â£©¡£
4¡¢Ê¹ÓÃÊÓͼ״̬µÄ×¢ÒâÊÂÏî
ÊÓͼ״̬ÌṩÁËÌض¨ ASP.NET Ò³µÄ״̬ÐÅÏ¢¡£Èç¹ûÐ
Ïà¹ØÎĵµ£º
1¡¢Ìí¼ÓÒ»¸öÍøÕ¾µØͼÏî Web.sitemapÏî
2¡¢ÔÚ Web.sitemapÏîµÄд·¨ÈçÏ£º
<?xml version="1.0" encoding="utf-8"?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0
">
<siteMapNode url="default.aspx" title="Ê×Ò³&qu ......
ѧϰJQueryʱ£¬·¢ÏÖJQueryÖ»ÄÜ×öµ¥ÐÐÍÏ·Å£¬ ÓÚÊÇ»¨Ê±¼ä×öÁËÒ»¸ö¶àÐÐÍϷŵÄÀý×Ó£¬ ÒÔ±¸ÒÔºóʹÓá£
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="jquery-1.3.2.js"></scri ......
ÓÉÓÚ asp.net ajax ·â×°Á˺ܶàºÜºÃµÄ·½·¨£¬ËùÒÔʹÓÃÕâ¸ö¿ò¼Üµ÷ÓÃwebwervice±äµÄ·Ç³£¼òµ¥¡£
µÚÒ»²½
webservice ÀàµÄ·½·¨ÐèÒªÓÐscriptServiceµÄ attribute.
namespace ServiceTest
{
/// <summary>
///WebService µÄժҪ˵Ã÷
/// </summary>
[WebService(Namespace = "http://tem ......
״̬¹ÜÀíÊÇÄú¶Ôͬһҳ»ò²»Í¬Ò³µÄ¶à¸öÇëÇóά»¤×´Ì¬ºÍÒ³ÐÅÏ¢µÄ¹ý³Ì¡£ÓëËùÓлùÓÚ HTTP µÄ¼¼ÊõÒ»Ñù£¬Web ´°ÌåÒ³ÊÇÎÞ״̬µÄ£¬ÕâÒâζ×ÅËüÃDz»×Ô¶¯Ö¸Ê¾ÐòÁÐÖеÄÇëÇóÊÇ·ñÈ«²¿À´×ÔÏàͬµÄ¿Í»§¶Ë£¬»òÕßµ¥¸öä¯ÀÀÆ÷ʵÀýÊÇ·ñÒ»Ö±Ôڲ鿴ҳ»òÕ¾µã¡£´ËÍ⣬µ½·þÎñÆ÷µÄÿһÍù·µ¹ý³Ì¶¼½«Ïú»Ù²¢ÖØд´½¨Ò³£»Òò´ ......