ASP值view State

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; public partial class _Default : System.Web.UI.Page
{
public static int number = 0;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
number = 0;
} } protected void Button1_Click(object sender, EventArgs e)
{
ViewState["num"] = number;
number = (int)ViewState["num"];
number++; this.Label1.Text = "你点击了" + number.ToString() + "次"; } }

  

上一篇:struts1&&Hibernate Demo1


下一篇:HT for Web嵌入QtWebKit的客户端解决方案