Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8660239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:12:25+00:00 2026-06-12T16:12:25+00:00

I have a table with loads on entry, theres 10 entry by page, and

  • 0

I have a table with loads on entry, theres 10 entry by page, and around 130 total page.

how can I handle an action on the same view while still retaining the paging in memory …

@using (Html.BeginForm())
        {
        <label>All Logs since :</label> <input id="startDate" name="startDate" class="datepicker" type="text" value="@Model.option.startDate.Value.ToString("dddd, dd MMMM yyyy")" />

<input type="submit" />
        }

When this is submitted, I want the table to be filter base on the start Date. But if the user click on a page link, I need this research result to override the default setting in my view. heres the action in my controller :

[HttpGet]
    public ActionResult Index(int? id)
    {
            MainViewModel model = new MainViewModel();

                model.option = new LogOption();
                model.option.numberOfResultPerPage = 10;
                model.option.startDate = (method to set default date)
                model.option.startPageIndex = id ?? 1;

                *** call to service with the model.options as filter and set my table's column info  and retreive the logs total in a custom class ( model.listing ) *** 

                model.totalPage = model.listing.TotalPages;

            return View(model);

now when the user submit a new Date, I do the exact same thing, but with a small difference, which is to set the default date to something like that :

[HttpPost]
    public ActionResult Index(LogOption mod)
    {

        model.option.startDate = mod.startDate;
     }

the problem is that if after the startDate filter have been modified, if the user click to change the page from my table, the get action is called again, and I dunno how to handle the overriding of the original default setting. can i do that in a cleaner way without having to set the info in session ?

I guess I need to pass the model along with the get info, but I havent been able to do it .

 [HttpPOST]
    public ActionResult Index(MainViewModel mod, int? id)
    {
     }

but my MainViewModel is always null when I do this, so I dont know how to get both information aside from saving it in session, but I was told to avoid that and that it was possible to do it other way

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:12:26+00:00Added an answer on June 12, 2026 at 4:12 pm

    I just realise I was trying to save my GET info into the POST action … which is kinda stupid logic

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that loads a cell in various table views. I want
I have a page where I load a table of information using ajax. Once
I have a page that displays XML info in a table. The XML files
I have a table with around 20 columns with mostly consisting of varchars and
I have an ASP page which consist of a table that is generated with
I have this basic model: When I fetch an entry from the book table
I have a table called tbl_loans which has the field loan_number . Loan numbers
I have table with 4 primary key fields. I load that in to drop
I have a table with composite primary key. I am trying to load data
I have a script that drops a load of tables using DROP TABLE IF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.