Asp.Net C#ÖÐSession ÈçºÎ´¢´æÈ¡ÐÅÏ¢
ÒòΪ¸Õ¸Õ½Ó´¥C#ÓïÑÔ²»¾Ã,ÓÚÊÇÎÒ°Ñ¿ØÖÆÌ¨¸øÈÓÁË,ÒòΪÎÒÌÖÑá¿ØÖÆÌ¨!
¶øÊÂʵÉÏÎÒÖ»¶ÔWinForm¼¼Êõ¸ÐÐËȤ,µ«ÊÂʵÉϵ½ÏÖÔÚÎÒ·¢ÏÖASP.Net C#µÄWeb¼¼ÊõÊÇÈÕÏÔÖØÒªÆðÀ´!
ÓÚÊÇ¿ªÊ¼½Ó´¥,¸Õ¸ÕÆð²½ÓÚËùÖª,ÓÈÆäÊÇһЩ×î¼òµ¥µÄ¶«Î÷,µ½ÍøÉÏËÑË÷Á˺ܾÃ,²»ÊÇÌ«ÂÒ¾ÍÊÇ˵²»Çå³þ!
¾Ù¸öÀý×ÓÀ´Ëµ,¾Í˵SessionºÃÁË,²»ÖªµÀÍøÉϵÄÄÇЩ¼Ò»ïµ½µ×ÔÚ½²Ê²Ã´?
»òÐíÊÇÎÒÌ«±¿°É!ÕæÊÇÎÞ·¨Àí½âËûÃǵĶ«¶«!
ÓÚÊÇÎÒ»¹ÊǾö¶¨×Ô¼ºÑо¿Ò»ÏÂ,½ñÌìÏÂÎ绨ÁËÒ»µãʱ¼ä,Êܵ½³É¹ûÈçÏÂ:
(1)Load.aspx.csÎļþÖÐ:
public class MYuser
{
public MYuser()
{
}
private string name;
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
}
//×¢ÒâMYuserÕâ¸öÀà´úÂëµÇ½µÄÓû§¶ÔÏóµÄÀà
//ÎÒ°ÑËüдÔÚÁËLoad.aspx.csÎļþÖÐ:µ«²»ÊÇLoadÀàÖÐ,¶øÖ»ÊÇͬһÃüÃû¿Õ¼ä
(2)Load.aspx.csÎļþÖÐ:
protected void Button1_Click(object sender, EventArgs e)
{
try{
&n
Ïà¹ØÎĵµ£º
ÔÚWeb¿ª·¢³ÌÐòÖУ¬ÍùÍùÓÉÓÚÖÖÖÖÔÒò£¬¿Í»§»á¶à´Î²Ù×÷Ò³Ãæµ¼ÖÂÊý¾ÝÈßÓà»ò²»Ò»Ö£¬ ÔÚASP.NET AJAX³öÏÖ֮ǰ¿ÉÒÔͨ¹ý¶Ô__dopostback()µÄµ÷Óõȷ½·¨Ò²¿ÉÒÔ·ÀÖ¹Ò³Ãæ¶à´ÎÌá½»¡£
ÔÚASP.NET AJAXÖеÄÒ³Ãæ¿Í»§¶ËÖÐÓÐÒ»¸ö½ÐonInitializeRequestµÄʼþ£¬ËüÔÚÒ³Ãæ³õʼ»¯Ö®Ç°´¥·¢£¬¿ÉÒÔ¶ÔÒ³ÃæµÄÌύʼþ½øÐпØÖÆ£¬²¢ÇÒ¿ÉÒÔµ÷ÓøÃʼþ²Î ......
Êý¾Ý°ó¶¨¿Ø¼þ±È½Ï(Reapter\DataList\GridView\DatailsView\FormView):
1.²åÈ빦ÄÜ·½Ãæ:
DetailsViewºÍFormView¾ßÓвåÈ빦ÄÜ,ÆäËü¿Ø¼þûÓÐ
2.Ä£°å
DataList\FormView\RepeaterÈýÖÖ±ØÐë±à¼Ä£°å,¶ø
GridViewºÍDetailsViewÖ»ÓÐÔÚ½«ÁÐת»»³ÉÄ£°åÁÐÒÔºó²Å»á³öÏÖ¸÷ÖÖÄ£°å.
3.×Ô¶¯·ÖÒ³¹¦ÄÜ
GridView ,DetailsViewºÍFormView ......
¸Õ¸Õ ¿´µ½Õâôһ¸öÎÊÌ⣬ÕâÀïÒ²×ö¸ö±ê¼Ç£ºhttp://topic.csdn.net/u/20080411/14/7b0f9da5-0413-4149-91e9-72c3df3018a3.html?seed=327251592
µÚÒ»ÖÖ·½Ê½£º
//ÔÚVisual Studio 2008Öе÷ÊÔͨ¹ý
testPop_Page.aspx:Ö÷Ò³ÃæASPX´úÂë
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  ......
asp.net ajaxÖÐÎÄÂÒÂëµÄ½â¾ö£¿
2010-01-19 12:06
ÒÔǰûÔõô×ÐϸµÄÑо¿¹ýajax,Ö»ÊÇÓõ½Á˾ÍÖ±½ÓÄùýÀ´ÓÃ,·¢ÏÖÁËÎÊÌâÔÙÕÒ½â¾ö·½·¨.ÒÔÏÂÊÇÎÒÔÚÕÒ½â¾öÎÊÌâµÄ¹ý³ÌÖеÄÒ»µãССµÄ×ܽá.
Ò».̸AjaxµÄGetºÍPostµÄÇø±ð
Get·½Ê½:
ÓÃget·½Ê½¿É´«Ëͼòµ¥Êý¾Ý£¬µ«´óСһ°ãÏÞÖÆÔÚ1KBÏ£¬Êý¾Ý×·¼Óµ½urlÖз¢Ë ......
ÕâÊÇҪʵÏֵŦÄÜ£º
µÚÒ»²½£ºÍÏÈëGridView¿Ø¼þ ²¢ÇÒÍê³É²éѯËùÓÐÊý¾ÝµÄ·½·¨ ͨ¹ýthis.GridView1.DataSource »ñÈ¡¼¯ºÏÊý¾Ý GridView1.DataBind() °ó¶¨Êý¾Ý
µÚ¶þ²½£ºÊµÏÖȫѡ¹¦ÄÜ
1. Ò³Ãæ´úÂ룺
´úÂë
<asp:TemplateField HeaderText="ȫѡ">
&nbs ......