AjaxÓëSessionµÄÎÊÌâ - .NET¼¼Êõ / ASP.NET
֮ǰÓöµ½Ò»¸öÎÊÌâ¡£
ÓÚÊÇ×öÁËÒÔÏÂʵÑ飺
Ò³Ãæ¼ÓÔغó£¬Ìá½»Ò»¸öAjaxÇëÇó(ÔݳÆΪajax1)£¬ÇëÇóµÄÏß³ÌÔÚ·þÎñÆ÷Éϱ»Ë¯Ãß10ÃëÖÓ¡£
µã»÷Ò³ÃæÉÏÒ»¸öbutton£¬´¥·¢ÁíÒ»¸öAjaxÇëÇó(ajax2)¡£
µ±Ã»ÓÐʹÓÃsession£¬ÔÚ·þÎñÆ÷δ´¦ÀíÍêajax1µÄÇëÇóʱ£¬·þÎñÆ÷ÒÀÈ»¿ÉÒÔ´¦Àíajax2µÄÇëÇó¡£
µ«ÊÇ£¬µ±Ê¹ÓÃÁËsession£¬ÔÚ·þÎñÆ÷δ´¦ÀíÍêajax1µÄÇëÇóʱ£¬·þÎñÆ÷²»ÄÜ´¦Àíajax2µÄÇëÇó¡£±ØÐëµÈµ½ajax1´¦ÀíÍê³Éºó£¬²ÅÄÜ´¦Àíajax2µÄÇëÇó¡£
ʹÓÃsessionµÄ´úÂëºÜ¼òµ¥£¬Session.Add("user", "aaa");
Çó½ÌÅ£ÈË£¬ÈçºÎÔÚʹÓÃÁËsessionºó£¬µ±ajax1δ´¦ÀíÍê³Éʱ£¬ÒÀÈ»¿ÉÒÔ´¦Àíajax2µÄÇëÇó£¿
Õâ¸öÎÊÌ⣬ÈÃÎÒºÜÍ·´ó¡£
ajax²»ÊÇ·¢Ë͵ÄÒì²½ÇëÇóÂð£¿
Ϊʲô£¬Ê¹ÓÃÁËsessionºó£¬¾Í±ä³Éͬ²½µÄÁË£¿
Äã´úÂëÊÇÔõôдµÄ
ʵÏÖʲô¹¦ÄÜ£¬´úÂëÈçºÎ±àдµÄ.˳ÐòÖ´ÐоÍÊÇ
´úÂëÌù³öÀ´
http://www.zainanbao.com
ÎÒÏëµÄÊÇAjax1ºÍAjax2ÕâÁ½¸öÇëÇóÊDz»ÊǶ¼Óõ½ÁËsessionÄØÁË´úÂëÖУ¬ÒªÊǶ¼Óõ½ÁË£¬¿ÉÄÜsession²»ÔÊÐíͬʱ½øÐзÃÎÊ£¬ËùÒÔµ¼ÖÂÁËÄãÏÖÔÚµÄÇé¿ö¡£
..»¹Õæ²»ÖªµÀÓÐÕâÇé¿ö.
C# code:
protected void Page_Load(object sender, EventArgs e)
{
//ʹÓÃsessionµÄ´úÂë
Session.Add("user", "aaa");
switch (Request.QueryString["action"])
{
case "ajax1":
Thread.S
Ïà¹ØÎÊ´ð£º
Ç°¶Îʱ¼äÅöµ½Ò»µÀÃæÊÔÌâÈçÏ£º
test.aspxÒ³ÃæÓÐÈçÏ´úÂ룺
Response.Write(Test.GetDate());
TestÀàÈçÏ£º
public class Test
{
static string dt="";
public static s ......
ÕýÔÚѧϰÕâ¸ö¶«¶« ¸Ð¾õºÜ¶àµØ·½²»ÊǺܶ® ÕýÔÚŬÁ¦ É¢µã·Û¸øasp.netµÄͬÈÊÃÇ Çó½ÌºÃµÄѧϰ×ÊÁÏ Ð»Ð»
²Î¿¼
asp.net/mvcÉÏÓкܶàÄÚÈÝ¡£
×î½üÒ²ÔÚ¿´¡£
ͬÁÄ¡£
JF,3Q
±ÈÎÒÓÐǰ;, ÎÒÖÁÉÙÄ¿Ç° ......
ASP.NET MVC¼Ü¹¹·¢²¼ÁË,ÄãÓÃÁËÂð£¿
»¹ÔÚѧϰÖÐ
ÎÒÒ²ÔÚѧϰ¡£ÂòÊ飬Ìý½Ì³Ì£¬¿´ÍøÉÏ×ÊÁÏ£¬ÏÂÔØÀý×Ó£¬¸Ð¾õÌý²»´íµÄ£¬²»¹ý±ÈÆ𹤳§Ä£Ê½£¬ËƺõÑ·É«Á˵㡣¡£¡£»¶Óµ½ÎÒ²©¿Í»¥Ïàѧϰ
¶¼ÓÃÁË5¸ö°æ±¾ÁË ´Ó PV1 µ½beta ......
ÎÒÏëÿÌì°ëÒ¹×Ô¶¯Éú³É¾²Ì¬Ò³Ãæ¡£
ÔõôʵÏÖÕâ¸ö·½·¨¡£
ÄÇλ¸ßÊÖÖªµÀ£¬Çë´Í½ÌÏ¡£
д·þÎñ!
Ôõôд
д·þÎñ ¿ªÏß³Ì Ð´Îļþ ÈëÊý¾Ý¿â
д·þÎñ»òÕßÓÿªÔ´µÄµ÷¶È¿ò¼ÜQuartz.net
½¨ÒéÓúóÕߣ¬ºóÕßÌṩ±È½ÏÁé»îµ ......