asp.net Ò³Ãæ´«Öµ
Ö±½Ó»ñµÃÒ³Ãæ²ÎÊý£º
if(!IsPostBack) { //ÅжÏÊÇ·ñÊǵÚÒ»´Î¼ÓÔØ´°Ìå
}
if(Page.PreviousPage!=null){ // ÅжÏÉÏÒ»Ò³ÃæµÄ°´Å¥ÊÇ·ñÉèÖÃÁËPostBackUrlÊôÐÔ
if(PreviousPage.IsCrossPagePostBack){ //ÅжÏÒ³ÃæÊÇ·ñʹÓÿçÒ³Ìá½»
TextBox keyword = this.PreviousPage.FindControl(id) as TestBox; // »ñµÃÉÏÒ»Ò³ÃæµÄÏà¶ÔÓ¦IDµÄÖµ
}
}
ʹÓ÷¶Î§±äÁ¿£º
Cookie¶ÔÏó£º(±£´æÔÚ¿Í·þ¶Ë)
Óï·¨£º
Response.Cookies[CookieµÄÃû³Æ].value = ±äÁ¿Ãû;
string ±äÁ¿Ãû = Request.Cookies[CookieµÄÃû³Æ].value;
HttpCookie hcCookie = new HttpCookie("CookieµÄÃû³Æ","Öµ");
Response.Cookies.Add(hcCookie);
ÊôÐÔ£º
Name / Value / Expires(É趨Cookie±äÁ¿µÄÓÐЧʱ¼ä)
Session¶ÔÏó£º(±£´æÔÚ·þÎñÆ÷)
Óï·¨£º
Session["SessionÃû³Æ"] = Öµ;
±äÁ¿ = Session["SessionÃû³Æ"];
ÊôÐÔ£º
TimeOut / Clear(´Ó»á»°×´Ì¬¼¯ºÏÖÐÒƳýËùÓеļüºÍÖµ) / Abandon (½áÊøSession£¬È¡Ïûµ±Ç°»á»°)
Application¶ÔÏó£º
Óï·¨£º
Application["ApplicationÃû³Æ"] =
Ïà¹ØÎĵµ£º
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
namespace jiu ......
¸üз½·¨Ò»£¬Ö±½ÓÔÚGridViewÖÐÀ´¸üÐÂÊý¾Ý.
¸üз½·¨¶þ£¬´ò¿ªÒ»¸öеÄÒ³ÃæÀ´¸üÐÂÊý¾Ý.
//¸üÐÂ
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
&nbs ......
½éÉÜ£º
ÔÚÍøÒ³Ó¦ÓóÌÐòµÄ¿ª·¢ÖУ¬Ò³ÃæÖ®¼äµÄ´«ÖµÓ¦¸ÃÊÇ×î³£¼ûµÄÎÊÌâÁË¡£ ÔÚÕâƪÎÄÕÂÀazamsharp ½«ÎªÎÒÃǽéÉÜһЩASP.NETÒ³Ãæ´«ÖµµÄ·½Ê½¡£±¾ÎÄËù¾ÙµÄÀý×ӷdz£¼òµ¥£¬½ö½ö°üº¬ÁËÒ»¸öÎı¾¿òºÍ¼¸¸ö°´Å¥£¬µ±°´Å¥µã»÷ʱÎı¾¿òÖеÄ×Ö·û´®½«»áÒÔ²»Í¬µÄ·½Ê½´«µÝµ½ÁíÍâµÄÒ³ÃæÈ¥¡£
1. Response.Redirect £¨» ......
<script language="javascript" type="text/javascript">
¡¡¡¡function doubleSalary()
¡¡¡¡{
¡¡¡¡var employee = new Object();
¡¡¡¡employee.FirstName = "X";
¡¡¡¡employee.LastName = "PP";
¡¡¡¡employee.Salary = 1000;
......