Model.Dog dog = null; protected void Page_Load(object sender, EventArgs e) { dog = Session["DogData"] as Model.Dog; if (!this.IsPostBack) { BindToGridView(); } } private void BindToGridView() { //首先是获取操作者是否具有系统查询的这样的权限 if (dog.SystemSearch) { ..........上面的变量dog通过Session["DogData"] 来赋值