ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ×ܽá
¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬Òý·¢Á˺ܶàÌÖÂÛ¡£¿´À´ÓкܶàÈ˹Ø×¢Õâ¸ö£¬ÎÒ¾ÍÎÒ¸öÈ˹۵ã×öÁËЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1. ʹÓÃQueryString±äÁ¿
QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝÊý×é»ò¶ÔÏóµÄ»°£¬¾Í²»ÄÜÓÃÕâ¸ö·½·¨ÁË¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
string s_url;
s_url = "b.aspx?name=" + Label1.Text;
Response.Redirect(s_url);
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
Label2.Text = Request.QueryString["name"];
}
2. ʹÓÃApplication ¶ÔÏó±äÁ¿
Application¶ÔÏóµÄ×÷Ó÷¶Î§ÊÇÕû¸öÈ«¾Ö£¬Ò²¾ÍÊÇ˵¶ÔËùÓÐÓû§¶¼ÓÐЧ¡£Æä³£Óõķ½·¨ÓÃLockºÍUnLock¡£
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
Application["name"] = Label1.Text;
Server.Transfer("b.aspx");
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
string name;
Application.Lock();
name = Application["name"].ToString();
Application.UnLock();
}
3. ʹÓÃSession±äÁ¿
Ïë±ØÕâ¸ö¿Ï¶¨ÊÇ´ó¼ÒʹÓÃÖÐ×î³£¼ûµÄÓ÷¨ÁË£¬Æä²Ù×÷ÓëApplicationÀàËÆ£¬×÷ÓÃÓÚÓû§¸öÈË£¬ËùÒÔ£¬¹ýÁ¿µÄ´æ´¢»áµ¼Ö·þÎñÆ÷ÄÚ´æ×ÊÔ´µÄºÄ¾¡¡£
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
Session["name"] = Label.Text;
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
string name;
name = Session["name"].ToString();
}
4. ʹÓÃCookie¶ÔÏó±äÁ¿
Õâ¸öÒ²ÊÇ´ó¼Ò³£Ê¹Óõķ½·¨£¬ÓëSessionÒ»Ñù£¬ÆäÊÇʲ¶Ôÿһ¸öÓû§¶øÑԵģ¬µ«ÊÇÓиö±¾ÖʵÄÇø±ð£¬¼´CookieÊÇ´æ·ÅÔÚ¿Í»§¶ËµÄ£¬¶øsessionÊÇ´æ·ÅÔÚ·þÎñÆ÷¶ËµÄ¡£¶øÇÒCookieµÄʹÓÃÒªÅäºÏASP.NETÄÚÖöÔÏóRequestÀ´Ê¹Óá£
a.a
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
ÔÚGridViewÖÐÎÒÃÇ¿ÉÒÔÖ±½ÓÌí¼ÓÒ»¸öCommandFieldɾ³ýÁÐÀ´É¾³ýijÐÐÐÅÏ¢¡£µ«ÎªÁ˱ÜÃâÎó²Ù×÷ÒýÆðµÄÎóɾ³ý£¬ÔÚɾ³ý²Ù×÷ÕßÈòÙ×÷ÕßÔÙÈ·ÈÏÏ£¬ÍêºóÔÙ½øÐÐɾ³ý¡£
¡¡¡¡Ê×ÏÈÎÒÃǸøÎÒÃǵÄGridView Ìí¼ÓÒ»¸öÄ£°åÁУ¬ÈçÏ£º
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
£¼ASP:TemplateField HeaderText="Delete" ShowHeader="False"£¾
£¼ItemStyle ......
ÃüÃû¿Õ¼ä Access
Àࣺ
User
ÊôÐÔ£ºLoginID,UserName,Password,Remark
Role
ÊôÐÔ£ºRoleName Remark(±¸×¢ÐÅÏ¢)
AccessItem
ÊôÐÔ£ºName,Text,Remark
PermissionManager
ÊôÐÔ£º
·½·¨£ºvoid AddUser(string loginID,string password, string remark );void AddRole();Void AddItem(string name,string text,strin ......
ÎÒ們ÔÚ開發網頁應ÓóÌʽ£¬時³£ÐèҪȥ½âÎö網Ö·(Request.Url)µÄÿ個Ƭ¶Î£¬進ÐÐһЩÅÐ斷¡£ÀýÈç說 "http://localhost:1897/News/Press/Content.aspx/123?id=1#toc
"£¬ÎÒ們ÏëҪȡµÃ網Ö·裡µÚÒ»層Ä¿錄µ ......