Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ACCOUNT"] == null)
        {
            Response.Redirect("../Login.aspx");
        }

        try
        {
            this.itemId = int.Parse(Request["id"].ToString());
        }
        catch
        {
            Response.Redirect("/Category/ListCategory.aspx");
        }

        DanhMuc objDanhMuc = new DanhMuc();

        DataRow danhuc = objDanhMuc.getDanhMuc(itemId);

        if (danhuc == null)
        {
            Response.Redirect("/Category/ListCategory.aspx");
        }

        Session["TITLE"] = danhuc["NameDanhMuc"].ToString().ToUpper();


        DataTable objData = objDanhMuc.getList(itemId);

        //dtlAccount.DataSource = objData.DefaultView;
        //dtlAccount.DataBind();

        cpData.MaxPages      = 1000;
        cpData.PageSize      = 15;
        cpData.DataSource    = objData.DefaultView;
        cpData.BindToControl = dtlData;
        dtlData.DataSource   = cpData.DataSourcePaged;
        dtlData.DataBind();

        index = 1;
    }