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.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
HttpCookie cookie_name = new HttpCookie("name");
&nbs
Ïà¹ØÎĵµ£º
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Sy ......
ÕâÀïÎÒÃǽ«½éÉÜASP.NET»º´æµÄ¹¤×÷ÔÀí£¬°üÀ¨¼òµ¥µÄ¶¨Ò壬Êý¾Ý»º´æÒÔ¼°»º´æµÄÉèÖõȵÈÄÚÈÝ¡£Ï£Íû±¾ÎÄÄܶԴó¼Ò½ñºóµÄ¹¤×÷ÓÐËù°ïÖú¡£
ÈçºÎ±ÜÃâASP.NET»º´æÕ¼ÓÃϵͳ×ÊÔ´
ÔÙ̸ASP.NET»º´æ»úÖÆ£º¿ª·¢Ð§ÂÊÓëÓÅ»¯µÄ..
ASP.NET»º´æ»úÖÆ»ù´¡¸ÅÄî
ASP.NET»º´æÊý¾ÝÌí¼Ó·½·¨Ò»ÀÀ
ASP.NET»º´æÊý¾Ý¼¼ÇÉÈýÔò
½éÉÜ
»º´æÊÇÔÚÄÚ´æ´ ......
Êý×Ö/×Öĸ»ìºÏºÜ¼òµ¥µÄ£¬¿´×űȽÏÊæ·þ£¬Ç°Ì¨Éú³ÉµÄaspxÎļþÎҾͲ»Ìù³öÀ´ÁË£¬Ä¬Èϵģ¬ÎÒҲδ×÷Ð޸ġ£ÏÂÃæÖ»Ìù³öºǫ́µÄcs´úÂë¡£½ö¹©²Î¿¼¡£
public partial class CheckCode : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.CreateCheckCodeImage( ......
¡¡½éÉÜ:
¡¡¡¡ÔÚÎÒ½âÊÍcache¹ÜÀí»úÖÆʱ£¬Ê×ÏÈÈÃÎÒ²ûÃ÷ÏÂÒ»¸ö¹ÛÄIEÏÂÃæµÄÊý¾Ý¹ÜÀí¡£Ã¿¸öÈ˶¼»áÓò»Í¬µÄ·½·¨È¥½â¾öÈçºÎÔÚIEÔÚ¹ÜÀíÊý¾Ý¡£ÓеĻáÌáµ½ÓÃ״̬¹ÜÀí£¬ÓеÄÌáµ½µÄcache¹ÜÀí£¬ÕâÀïÎұȽÏϲ»¶cache¹ÜÀí£¬ÒòΪ±¾È˱ȽÏϲ“cache”Õâ¸ö´Ê¡£µ«ÊÇ״̬¹ÜÀíºÍcache¹ÜÀíÕâÁ½¸öÔÚ¸ÅÄîºÍÒâÒåÉÏÊDz»Í¬µÄ£¬ÏÂÃæ¾ÍÈÃÎÒ ......