Exemplo n.º 1
0
    /// <summary>
    /// 初始化按钮栏
    /// </summary>
    protected void InitTopButton()
    {
        //显示
        //this.TopButtons1.GetImageButton("add").Visible = true;
        //this.TopButtons1.GetImageButton("edit").Visible = true;
        //this.TopButtons1.GetImageButton("delete").Visible = true;
        //this.TopButtons1.GetImageButton("search").Visible = true;
        //客户端脚本
        this.Add1.MyButton.Attributes.Add("onclick", "return buttonAction('add')");
        this.Edit1.MyButton.Attributes.Add("onclick", "return buttonAction('edit')");
        this.Show1.MyButton.Attributes.Add("onclick", "return buttonAction('Show')");
        this.Delete1.MyButton.Attributes.Add("onclick", "return buttonAction('delete')");
        //this.TopButtons1.GetImageButton("add").Attributes.Add("onclick", "return buttonAction('add')");
        //this.TopButtons1.GetImageButton("edit").Attributes.Add("onclick", "return buttonAction('edit')"); ;
        //this.TopButtons1.GetImageButton("delete").Attributes.Add("onclick", "return buttonAction('delete')");
        //this.TopButtons1.GetImageButton("search").Attributes.Add("onclick", "return buttonAction('copy')");

        //事件
        this.Add1.AddClickEvent       += new Sysadmin_Controls_Add.AddClickHandler(Add1_AddClickEvent);
        this.Edit1.EditClickEvent     += new Sysadmin_Controls_Edit.EditClickHandler(Edit1_EditClickEvent);
        this.Delete1.DeleteClickEvent += new Sysadmin_Controls_Delete.DeleteClickHandler(Delete1_DeleteClickEvent);
        this.Show1.ShowClickEvent     += new Sysadmin_Controls_Show.ShowClickHandler(Show1_ShowClickEvent);
        JSUtility.ShowConfirm((WebControl)this.Delete1.MyButton, "确定要删除该项?");

        //权限
        //this.TopButtons1.GetImageButton("add").Visible = this.ValidateAccess("F100302");
        //this.TopButtons1.GetImageButton("edit").Visible = this.ValidateAccess("F100303");
        //this.TopButtons1.GetImageButton("delete").Visible = this.ValidateAccess("F100305");
    }