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
Ïà¹ØÎÊ´ð£º
aspÏÂÃæ£¬µ±Òª¸ù¾Ý²»Í¬µÄȨÏÞÏÔʾһЩ¹¦Äܰ´Å¥µÄ»°»áд³É
<%
if ȨÏÞ=1 then
%>
<input type="submit" name="Submit" value="Ìá½»" />
<%
end i ......
°ÑÒµÎñ²ãµÄ¶¼Ð´ÔÚdllÎļþÖÐÁË£¬ÏÖÔÚÏëÒªÐ޸쬴ó¼Ò¶¼ÓÃʲô¹¤¾ß´ò¿ª£¿
ÓÃvisual studio×Ô´øµÄ ildasm¿ÉÒÔÂð£¿
ÆÚ´ý¸ßÊÖ
LZºÃÀ÷º¦
Ó÷´±àÒëÈí¼þ
ÎÒÓÃReflectorÖ»ÄÜ¿´£¬²»Äܸİ¡£¿
ÓÐÃ ......
ÇëÎÊһϣ¬ASP.NETÎÒÓÃÒ»¸ö²ãÖзÅÁËÒ»¸öÈÕÀú¿Ø¼þ£¬ÔÚµãÒ»¸ö°´Å¥Ê±£¬ÏÔʾÕâ¸ö²ã£¿ÏÖÔÚÎÊÌâÊÇÎÒÔڵ㰴ťʱ£¬ÎÒÏë°Ñ²ãÏÔʾÔÚ°´Å¥µÄÏ·½£¿¾ÍÏñÏÂÀÈÕÆÚ¿Ø¼þÒ»Ñù£¬ÎÒÓÃÊǵÄASP.NET C#
ÎÒÓÐÕâôһ¸öÈÕÆÚ¿Ø¼þ£¬£¡µã»÷¿ÉÒÔÑ ......
ASP.NET MVC¼Ü¹¹·¢²¼ÁË,ÄãÓÃÁËÂð£¿
»¹ÔÚѧϰÖÐ
ÎÒÒ²ÔÚѧϰ¡£ÂòÊ飬Ìý½Ì³Ì£¬¿´ÍøÉÏ×ÊÁÏ£¬ÏÂÔØÀý×Ó£¬¸Ð¾õÌý²»´íµÄ£¬²»¹ý±ÈÆð¹¤³§Ä£Ê½£¬ËƺõÑ·É«Á˵㡣¡£¡£»¶Óµ½ÎÒ²©¿Í»¥Ïàѧϰ
¶¼ÓÃÁË5¸ö°æ±¾ÁË ´Ó PV1 µ½beta ......
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Namespace CBDAspNet.WebControls.HTML
''' <summary>
'' ......