예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlUserRole.DataSourceID = null;
         ddlUserRole.DataSource   = UserRoleManage.GetALLUserRole();
         ddlUserRole.DataBind();
         ddlUserRole.Items.Insert(0, new ListItem("请选择用户类型", "-1"));
     }
 }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Admin admin = (Admin)Session["admin"];
            if (admin == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            else
            {
                ddlUserRole.DataSourceID = null;
                ddlUserRole.DataSource   = UserRoleManage.GetALLUserRole();
                ddlUserRole.DataBind();
                Panelvisible();
            }
        }
        string UserRole = ddlUserRole.SelectedItem.Text.Trim();

        btnAddLost.Attributes.Add("onclick", "return confirm('您是要添加【" + UserRole + "】表的数据吗?');");
    }