نمایش نتایج 1 تا 2 از 2

نام تاپیک: جستجو اطلاعات به صورت صفحه بندی در Core Razor Pages

  1. #1

    جستجو اطلاعات به صورت صفحه بندی در Core Razor Pages

    سلام و خسته نباشید من میخوام عمل جستجو انجام بدم در Core Razor Pages کوئری هم نوشتم ولی مشکل در عملیات جستجو هستش.
    دستورات پراپرتی
     [BindProperty(SupportsGet = true)]
    public Log_Load.Show_Log ShowLogProp { get; set; }
    public List<Log_Load.Show_Log> ShowLogs { get; set; }
    Tbl_Log_Load tblLogLoad = new Tbl_Log_Load();

    دستور Load یا OnGet برای اجرا دستور
     public async Task OnGetAsync(int pageId = 1)
    {
    ShowLogs = tblLogLoad.Show_Log(pageId, 10).ToList();
    if (!string.IsNullOrEmpty(ShowLogProp?.P_Platform) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_Country) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_Region_Name) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_City) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_ISP) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_OS) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_Browser) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_IP_Server) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_Page_OR_Form _Name) ||
    !string.IsNullOrEmpty(ShowLogProp?.LL_Date))
    {
    // if (!string.IsNullOrEmpty(P_Platform) || !string.IsNullOrEmpty(LL_Country) ||
    // !string.IsNullOrEmpty(LL_Region_Name) ||
    // !string.IsNullOrEmpty(LL_City) || !string.IsNullOrEmpty(LL_ISP) || !string.IsNullOrEmpty(LL_OS) ||
    // !string.IsNullOrEmpty(LL_Browser) || !string.IsNullOrEmpty(LL_IP_Server) ||
    // !string.IsNullOrEmpty(LL_Page_OR_Form_Name) || !string.IsNullOrEmpty(LL_Date))
    //{
    if (ShowLogProp.P_Platform == null)
    {
    ShowLogProp.P_Platform = "";
    }
    if (ShowLogProp.LL_Country == null)
    {
    ShowLogProp.LL_Country = "";
    }
    if (ShowLogProp.LL_Region_Name == null)
    {
    ShowLogProp.LL_Region_Name = "";
    }
    if (ShowLogProp.LL_City == null)
    {
    ShowLogProp.LL_City = "";
    }
    if (ShowLogProp.LL_ISP == null)
    {
    ShowLogProp.LL_ISP = "";
    }
    if (ShowLogProp.LL_OS == null)
    {
    ShowLogProp.LL_OS = "";
    }
    if (ShowLogProp.LL_Browser == null)
    {
    ShowLogProp.LL_Browser = "";
    }
    if (ShowLogProp.LL_IP_Server == null)
    {
    ShowLogProp.LL_IP_Server = "";
    }
    if (ShowLogProp.LL_Page_OR_Form_Name == null)
    {
    ShowLogProp.LL_Page_OR_Form_Name = "";
    }
    if (ShowLogProp.LL_Date == null)
    {
    ShowLogProp.LL_Date = "";
    }
    ShowLogs = tblLogLoad.SearchAll(pageId, 10, ShowLogProp.P_Platform, ShowLogProp.LL_Country,
    ShowLogProp.LL_Region_Name
    , ShowLogProp.LL_City, ShowLogProp.LL_ISP, ShowLogProp.LL_OS, ShowLogProp.LL_Browser,
    ShowLogProp.LL_IP_Server, ShowLogProp.LL_Page_OR_Form_Name, ShowLogProp.LL_Date).ToList();
    }
    }

    این دستورات نوشتم و درست کار میکنه.
    ولی مشکلاتی داره دستورات
    اینم دستورات html هستش.
      <form method="post">
    <div class="form-group row">
    <label asp-for="ShowLogProp.P_Platform" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.P_Platform" placeholder="نوع سرویس دهنده" placeholder-class="placeholder-blue" id="P_Platform" class="form-control" name="P_Platform" maxlength="50">
    </div>
    <label asp-for="ShowLogProp.LL_Country" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_Country" placeholder="کشور" id="LL_Country" class="form-control" name="LL_Country" maxlength="250">
    </div>
    </div>
    <div class="form-group row">
    <label asp-for="ShowLogProp.LL_Region_Name" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_Region_Name" placeholder="نام منطقه" placeholder-class="placeholder-blue" id="LL_Region_Name" class="form-control" name="LL_Region_Name" maxlength="250">
    </div>
    <label asp-for="ShowLogProp.LL_City" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_City" placeholder="شهر" id="LL_City" class="form-control" name="LL_City" maxlength="250">
    </div>
    </div>
    <div class="form-group row">
    <label asp-for="ShowLogProp.LL_ISP" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_ISP" placeholder="ISP" placeholder-class="placeholder-blue" id="LL_ISP" class="form-control" name="LL_ISP" maxlength="250">
    </div>
    <label asp-for="ShowLogProp.LL_OS" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_OS" placeholder="سیستم عامل" id="LL_OS" class="form-control" name="LL_OS" maxlength="250">
    </div>
    </div>
    <div class="form-group row">
    <label asp-for="ShowLogProp.LL_Browser" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_Browser" placeholder="مرورگر" placeholder-class="placeholder-blue" id="LL_Browser" class="form-control" name="LL_Browser" maxlength="250">
    </div>
    <label asp-for="ShowLogProp.LL_IP_Server" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_IP_Server" placeholder="IP مرکزی" id="LL_IP_Server" class="form-control" name="LL_IP_Server" maxlength="50">
    </div>
    </div>
    <div class="form-group row">
    <label asp-for="ShowLogProp.LL_Page_OR_Form_Name" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_Page_OR_Form_Name" placeholder="نام صفحه یا فرم " placeholder-class="placeholder-blue" id="LL_Page_OR_Form_Name" class="form-control" name="LL_Page_OR_Form_Name" maxlength="250">
    </div>
    <label asp-for="ShowLogProp.LL_Date" class="col-md-2 col-form-label text-md-right"></label>
    <div class="col-md-4">
    <input type="text" asp-for="ShowLogProp.LL_Date" placeholder="تاریخ" id="LL_Date" class="form-control" name="LL_Date" maxlength="10">
    </div>
    </div>
    <div class="col-md-12 offset-md-1 text-center">
    @{
    var parms = new Dictionary<string, string>
    {
    {
    "ShowLogProp.LL_Country", Model.ShowLogProp.LL_Country

    }
    };
    }

    <input type="submit" name="Btn_Search" id="Btn_Search" asp-all-route-data="parms" value="جستجو" class="btn btn-primary" />
    </div>
    </form>

    کوئری به آدرس بار میفرسته ولی دستور OnGet وقتی صفحه رفرش میشه اجرا نمیشه و دومی مشکل وقتی پارمتر پاس میدم به جستجو و در آدرس بار میاد وقتی دستی میزنم جستجو میشه.
    توضیحات این سایت هم خوندم و پیاده کردم ولی متاسفانه باز به نتیجه نرسیدم.
    https://docs.microsoft.com/en-us/asp...aspnetcore-2.2
    تصویر ظاهر فرم مشاهده کنید
    پرامتر ها داخل آدرس بار هستش ولی جوابی نیست جز اینکه روی آدرس بار اینتر بزنم تا جستجو انجام بشه و دستور OnGet اجرا بشه.
    2019-08-28_10-24-14.png
    و الان 4 روز دارم حسابی میگردم و به نتیجه نرسیدم.
    این شناسه بنده هستش لطفا امکانش هستش بنده راهنمایی کنید ممنون میشم.
    @sdvp_1992 شناسه تلگرام بنده.
    لطفا امکانش باشه پیغام بدید و بنده کمک کنید ممنون میشم.

  2. #2

    نقل قول: جستجو اطلاعات به صورت صفحه بندی در Core Razor Pages

    مشکل اولیه پیدا کردم تو فرم به جای Method="Post" باید مینوشتم method="Get" این نوشتم درست شد.

تاپیک های مشابه

  1. سطح دسترسی در Layout Core Razor Pages
    نوشته شده توسط davidrobert در بخش ASP.NET Core
    پاسخ: 1
    آخرین پست: دوشنبه 21 مرداد 1398, 23:21 عصر
  2. دریافت IP کاربر وارد شده به سیستم در Razor Pages
    نوشته شده توسط davidrobert در بخش ASP.NET Core
    پاسخ: 2
    آخرین پست: چهارشنبه 11 اردیبهشت 1398, 13:10 عصر
  3. مشکل در ناقص Publish کردن Asp Core Razor Pages
    نوشته شده توسط davidrobert در بخش ASP.NET Core
    پاسخ: 2
    آخرین پست: دوشنبه 15 بهمن 1397, 13:15 عصر
  4. نگاهی به Razor Pages در ASP Core
    نوشته شده توسط hakim22 در بخش ASP.NET MVC
    پاسخ: 7
    آخرین پست: چهارشنبه 10 بهمن 1397, 22:26 عصر
  5. نمایش متن راست به چپ در Asp core razor pages
    نوشته شده توسط davidrobert در بخش ASP.NET Core
    پاسخ: 5
    آخرین پست: سه شنبه 02 بهمن 1397, 21:14 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •