Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.NETÖÐcookie¶Áд·½·¨½éÉÜ

Cookie (HttpCookieµÄʵÀý)ÌṩÁËÒ»ÖÖÔÚ Web Ó¦ÓóÌÐòÖд洢Óû§Ìض¨ÐÅÏ¢µÄ·½·¨¡£ÀýÈ磬µ±Óû§·ÃÎÊÄúµÄÕ¾µãʱ£¬Äú¿ÉÒÔʹÓÃCookie ´æ´¢Óû§Ê×Ñ¡Ïî»òÆäËûÐÅÏ¢¡£µ±¸ÃÓû§ÔٴηÃÎÊÄúµÄÍøÕ¾Ê±£¬Ó¦ÓóÌÐò±ã¿ÉÒÔ¼ìË÷ÒÔǰ´æ´¢µÄÐÅÏ¢¡£
ASP.NETÖеÄcookie£º´´½¨Cookie·½·¨ (1)
Response.Cookies["userName"].Value = “admin";
Response.Cookies[“userName”].Expires = DateTime.Now.AddDays(1);
//Èç¹û²»ÉèÖÃʧЧʱ¼ä,CookieÐÅÏ¢²»»áдµ½Óû§Ó²ÅÌ,ä¯ÀÀÆ÷¹Ø±Õ½«»á¶ªÆú¡£
ASP.NETÖеÄcookie£º´´½¨Cookie·½·¨ (2)
HttpCookie aCookie = new HttpCookie(“lastVisit”);
//ÉÏÒ»´Î·ÃÎÊʱ¼ä
aCookie.Value = DateTime.Now.ToString();
aCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(aCookie);
ASP.NETÖеÄcookie£º·ÃÎÊCookie·½·¨(1)
if(Request.Cookies["userName"] != null)
Label1.Text = Server.HtmlEncode(Request.Cookies["userName"].Value);
·ÃÎÊCookie·½·¨(2)
if(Request.Cookies["userName"] != null) {
HttpCookie aCookie = Request.Cookies["userName"];
Label1.Text = Server.HtmlEncode(aCookie.Value);
}
ASP.NETÖеÄcookie£º´´½¨¶àÖµCookie·½·¨ (1)
Response.Cookies["userInfo"]["userName"] = “admin";
Response.Cookies["userInfo"]["lastVisit"] = DateTime.Now.ToString();
Response.Cookies["userInfo"].Expires = DateTime.Now.AddDays(1);
ASP.NETÖеÄcookie£º´´½¨¶àÖµCookie·½·¨ (2)
HttpCookie aCookie = new HttpCookie("userInfo");
aCookie.Values["userName"] = “admin";
aCookie.Values["lastVisit"] = DateTime.Now.ToString();
aCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(aCookie);
ASP.NETÖеÄcookie£º¶ÁÈ¡¶àÖµCookie
HttpCookie aCookie = Request.Cookies["userInfo"];
string userName=aCookie.Values[“userName”];
string lastVisit=aCookie.Values[“lastVisit”];
ASP.NETÖеÄcookie£ºÐ޸ĺÍɾ³ýCookie
²»ÄÜÖ±½ÓÐ޸Ļòɾ³ýCookie£¬Ö»ÄÜ´´½¨Ò»¸öеÄCookie£¬·¢Ë͵½¿Í»§¶ËÒÔʵÏÖÐ޸Ļòɾ³ýCookie¡£


Ïà¹ØÎĵµ£º

ASP.NETÊý¾Ý°ó¶¨_µÚ¶þƪ_ÓÃÊý¾Ý¼¯DataTable°ó¶¨

+++ Ò³Ãæ´úÂëÈçÏ£º
<asp:Button ID="Button1" runat="server" Text="Ìí¼Ó¿ÕÐÐ" OnClick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="±£´æËùÓÐ" OnClick="Button2_Click" />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="403px">
  ......

ASP.NETÊý¾Ý°ó¶¨_µÚËÄÆª_ÓÃSqlDataSource¿Ø¼þ°ó¶¨_02

+++ Ò³Ãæ´úÂëÈçÏ£º
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" PageSize="3"
    AutoGenerateColumns="true" DataKeyNames="username" DataSourceID="SqlDataSource1"
    AutoGenerateDeleteButton="True"
    AutoGen ......

Asp.net MVC2ѧϰ±Ê¼Ç5 ¼òµ¥ÊµÀý(Movie)(ÉÏ)


Ç°Ãæ¶Ôroute¡¢controller¡¢view ÒѾ­ÓÐÁË»ù±¾µÄÁ˽⣬½ñÌìÎÒÃǾÍÀ´Ò»¸ö¼òµ¥µÄʵÀý -- Movie
¿ªÊ¼Ö®Ç°£¬¼òµ¥ËµÒ»Ï model(Ä£ÐÍ)£¬ÏàÐÅ´ó¼Ò×ö·Ö²ã¿ª·¢µÄʱºòÒ»¶¨ÓùýËü£¬MVCµÄmodelºÍËûÒ»Ñù£¬
ÿһ¸ömodel ¶ÔÓ¦Êý¾Ý¿âÒ»ÕÅ±í£¬ÕâÑùÎÒÃǾÍÊÇÓÃmodelµÄÊôÐÔ·ÃÎʱíÖÐÿһÐмǼµÄijһÁÐÖµ¡£
mvcÖÐÄã¿ÉÒÔ×Ô¼ºÐ´model£¬Ò²¿ÉÒÔʹ ......

»ùÓÚIPagedList µÄ Asp.Net MVC ·ÖÒ³

ÉÏ´Îд¹ýһƪMVC·ÖÒ³µÄ
×Ô¼ºÓõÄÒ»¸öASP.Net MVC·ÖÒ³ÄóöÀ´·ÖÏíÏÂ
ÏÖÔÚ·¢Ò»¸ö¸Ä½ø°æ
ÀïÃæÓõ½µÄIPagedListÎÒ×Ô¼ºÒ²¼Ç²»ÇåÊÇ´ÓÄÄÀïCOPYÀ´µÄÁË¡£ºÇºÇ
ÕâÀïÎҾͲ»°ÑIPagedListµÄ´úÂëÌù³öÀ´ÁË£¬ÒªÊ¹µÄÏÂÔØDEMO×Ô¼ºÄðɡ£
ºǫ́¶ÔÊý¾ÝµÄ·ÖÒ³
public ActionResult Index([DefaultValue(1)]int p,[DefaultValue(10)]int pages ......

ASP.NETÖеÄEval£¨£©ºÍDataBinder.Eval£¨£©·½·¨

ASP.NETÖеÄEval£¨£©ºÍDataBinder.Eval£¨£©·½·¨
2009-12-12 17:55
Eval( " ")ºÍBind( " ")¡¡ÕâÁ½ÖÖÒ»¸öµ¥Ïò°ó¶¨£¬Ò»¸öË«Ïò°ó¶¨
bindÊÇË«Ïò°ó¶¨,µ«ÐèÊý¾ÝÔ´¿É¸ü¸Ä²ÅÄÜÓÃ
ASP.NET 2.0¸ÄÉÆÁËÄ£°åÖеÄÊý¾Ý°ó¶¨²Ù×÷£¬°Ñv1.xÖеÄÊý¾Ý°ó¶¨Óï·¨DataBinder.Eval(Container.DataItem, fieldname)¼ò»¯ÎªEval(fieldname)¡£Eval·½· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ