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ÖеÄcookie£ºÐÞ¸Ä
HttpCookie aCookie = Request.Cookies["userInfo"];
aCookie.Values["use
Ïà¹ØÎĵµ£º
ÔÚweb·þÎñÆ÷¶Ë¿ª·¢Öо³£»áÓöµ½¸÷ÖÖ²»Í¬ÐÎʽµÄpath£¬¶øÇÒ¾³£¼Ç²»Çå³þÈçºÎ»ñÈ¡µ½Ä³ÖÖÌض¨¸ñʽ£¬½ñÌì³éÁ˵ãʱ¼ä°Ñ³£ÓõÄpath»ñÈ¡·½·¨Óë¸ñʽ×öÁËÒ»¸ö¼òµ¥µÄ¶ÔÕÕ±í£¬ÒÔ±¸ÈÕºó²éÓá£
Request»ñÈ¡µÄÐÅÏ¢
Request.AppRelativeCurrentExecutionFilePath &nb ......
1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯¡¡
¡¡
Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕÊ ......
ÔÚgridviewÖÐ
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<asp:TemplateField HeaderText="Remove">
&nbs ......
aspxÒ³Ãæ´úÂ룺
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ENRepeater.aspx.cs" Inherits="ENRepeater" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" & ......