protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TagName.Focus(); //string userid = Convert.ToString(Session["UserID"]); //if (Session["RoleID"] != null && !String.IsNullOrEmpty(Session["RoleID"].ToString()) && (Session["RoleID"].ToString() == "1" || Session["RoleID"].ToString() == "2")) //{ // //ClassifyPanel.Visible = true; // using (SqlConnection conn = new DB().GetConnection()) // { // string sql = "select * from UserTags where UserID = @UserID order by ID desc"; // SqlCommand cmd = new SqlCommand(sql, conn); // cmd.Parameters.AddWithValue("@UserID", userid); // conn.Open(); // SqlDataReader rd = cmd.ExecuteReader(); // TagsList.DataSource = rd; // TagsList.DataTextField = "TagName"; // TagsList.DataValueField = "ID"; // TagsList.DataBind(); // rd.Close(); // } //} //else //{ // ClassifyPanel.Visible = false; //} } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TagName.Focus(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["RoleID"] == null || Session["UserID"] == null) { Util.ShowMessage("用户登录超时,请重新登录!", "Login2.aspx"); } else { if (Convert.ToInt16(Session["RoleID"]) > 4) { Util.ShowMessage("对不起,你无权访问该页面!", "User_Center.aspx"); } else { TagName.Focus(); } } } }