private void GetAdvancedSearchRows()
    {
        string[] asearchfield = this.Request.Form.GetValues("asearchfield[]");
        if (asearchfield == null)
        {
            asearchfield = Asearchfield;
        }
        IDictionary <string, object> par = new Dictionary <string, object>();

        if (Mastertable == "AKTOR")
        {
            Asearchfor["NIP"] = (string)this.Session[strTableName + "_masterkey1"];
            par.Add("NIP", this.Session[strTableName + "_masterkey1"]);
        }
        if (Mastertable == "PBJ")
        {
            Asearchfor["KODEPBJ"] = (string)this.Session[strTableName + "_masterkey1"];
            par.Add("KODEPBJ", this.Session[strTableName + "_masterkey1"]);
        }
        string oCol = OwnerColumn;
        string oID  = OwnerID;

        if (func.IsAdminUser() || func.GetsAdvSecurityMethod(strTableName) == "2")
        {
            oCol = string.Empty;
            oID  = string.Empty;
        }
        if (par.Count > 0)
        {
            collection = controller.FetchForAdvancedSearch(asearchfield,
                                                           Asearchopt,
                                                           Asearchfor,
                                                           Asearchfor2,
                                                           Asearchnot,
                                                           (Asearchtype == "and"),
                                                           (PageNumber - 1) * PageSize,
                                                           PageSize,
                                                           OrderBy,
                                                           oCol, oID, par);

            numrows = controller.FetchForAdvancedSearchCount(asearchfield,
                                                             Asearchopt,
                                                             Asearchfor,
                                                             Asearchfor2,
                                                             Asearchnot,
                                                             (Asearchtype == "and"),
                                                             (PageNumber - 1) * PageSize,
                                                             PageSize,
                                                             OrderBy,
                                                             oCol, oID, par);
        }
        else
        {
            collection = controller.FetchForAdvancedSearch(asearchfield,
                                                           Asearchopt,
                                                           Asearchfor,
                                                           Asearchfor2,
                                                           Asearchnot,
                                                           (Asearchtype == "and"),
                                                           (PageNumber - 1) * PageSize,
                                                           PageSize,
                                                           OrderBy,
                                                           oCol, oID);

            numrows = controller.FetchForAdvancedSearchCount(asearchfield,
                                                             Asearchopt,
                                                             Asearchfor,
                                                             Asearchfor2,
                                                             Asearchnot,
                                                             (Asearchtype == "and"),
                                                             (PageNumber - 1) * PageSize,
                                                             PageSize,
                                                             OrderBy,
                                                             oCol, oID);
        }
    }