protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) //如果不是回传加载数据 { // 加载菜单 // treeMenu.DataSource = XmlDataSource1; // treeMenu.DataBind(); AjaxPro.Utility.RegisterTypeForAjax(typeof(indexs));//将本类的类型注册到ajaxPro中 好在js中调用该类的方法 rptPending.DataSource = ExamineManager.SearchPending("已办", "会议申请"); rptPending.DataBind(); if (Session["user"] == null) { Response.Redirect("login.aspx"); } else { UserInfo user = Session["user"] as UserInfo; uid = user.UID; log.Info(string.Format("{0}进入系统", user.Name)); if (user.Sex == "男") { lblLoginName.Text = user.Name + " 先生"; } else { lblLoginName.Text = user.Name + " 女士"; } //获取上次登录时间 lblTime.Text = Request.Cookies["LoginTime"].Value; lblCount.Text = Application["Count"].ToString(); InitTree(user.Name); //清除没有子节点的根节点 // ClearNodes(); try { log.Info("这是hansong的LOG INFO测试!"); log.Debug("这是hansong的LOG DEBUG测试!"); throw new Exception("这是hansong的LOG ERROR测试!"); } catch (Exception er) { log.Error("错误日志", er); } } } }
private void Bind() { try { PagedDataSource pds = new PagedDataSource(); pds.AllowPaging = true; pds.DataSource = ExamineManager.SearchPending(ddlState.SelectedValue, ddlType.SelectedItem.Text); Pager1.DataCount = pds.Count; pds.CurrentPageIndex = Pager1.PageIndex; pds.PageSize = 5; Pager1.PageCount = pds.PageCount; gvPending.DataSourceID = null; gvPending.DataSource = pds; gvPending.DataBind(); } catch (Exception) { return; } }