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 6843929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:18:46+00:00 2026-05-27T00:18:46+00:00

Here’s the situation: i have a SearchPage where an user can make a complex

  • 0

Here’s the situation: i have a SearchPage where an user can make a complex search. Nothing really unusual. After the results are displayed, the user can select one of them and move to another Page (Like a Master/Detail).

I have a breacrumb which holds the places where the user has been and it can have more than 4 levels (Like Main -> 2Page -> 3Page -> 4Page -> NPage). What i want is to maintain the state of each control on my complex search page, if the user uses the breacrumb to navigate backwards, since i don’t want them to manually set all those search filters again.

So far, i’ve been using javascript:history.back(), but since i can have multiple levels on my breadcrumb, this hasn’t been very useful. I was thinking about using OutputCache to do it, but i don’t know how i would proceed.

UPDATE

I’ve just talked to a co-worker and he told me that some of our combobox (dropdownlist) are dynamically generated. So if the user select one item on the first combobox, the second will be filled with data related to the first selection.

  • 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-05-27T00:18:47+00:00Added an answer on May 27, 2026 at 12:18 am

    OutputCache would cache the results for every user. Why don’t you try to store the information in a cookie with page url and filter information. Each time an action is executed, read the cookie and populate the model (custom model for search) with those values found (if they match the page url, action in this situation). Pass the model to the view and let it repopulate the search criteria text boxes and check boxes.

    UPDATE:
    When a user fills in the search filter text boxes, you are passing that information back to a controller somehow. Probably as some kind of a strongly typed object.

    Let’s say your users get to enter the following information:
    – Criteria
    – StartDate
    – EndDate

    There is a model called SearchCriteria defined as:

    public class SearchCriteria
    {
        public string Criteria { get; set; }
        public DateTime? StartDate { get; set; }
        public DateTime? EndDate { get; set; }
    }
    

    Your action could look something like this:

    [HttpGet]    
    public ViewResult Search()
    {
        SearchCriteria criteria = new SearchCriteria();
    
        if (Request.Cookies["SearchCriteria"] != null)
        {
            HttpCookie cookie = Request.Cookies["SearchCriteria"];
            criteria.Criteria = cookie.Values["Criteria"];
            criteria.StartDate = cookie.Values["StartDate"] ?? null;
            criteria.EndDate = cookie.Values["EndDate"] ?? null;
        }
    
        return View(criteria);
    }
    
    [HttpPost]
    public ActionResult Search(SearchCriteria criteria)
    {
        // At this point save the data into cookie
        HttpCookie cookie;
    
        if (Request.Cookies["SearchCriteria"] != null)
        {
            cookie = Request.Cookies["SearchCriteria"];
            cookie.Values.Clear();
        }
        else
        {
            cookie = new HttpCookie("SearchCriteria");
        }
    
        cookie.Values.Add("Criteria", criteria.Criteria);
    
        if (criteria.StartDate.HasValue)
        {
            cookie.Values.Add("StartDate", criteria.StartDate.Value.ToString("yyyy-mm-dd"));
        }
    
        if (criteria.EndDate.HasValue)
        {
            cookie.Values.Add("EndDate", criteria.EndDate.Value.ToString("yyyy-mm-dd"));
        }
    
        // Do something with the criteria that user posted
    
        return View();
    }
    

    This is some kind of a solution. Please understand that I did not test this and I wrote it from top of my head. It is meant to give you an idea just how you might solve this problem. You should probably also add Action to SearchCriteria so that you can check whether this is an appropriate action where you would read the cookie. Also, reading and writing a cookie should be moved into a separate method so that you can read it from other actions.

    Hope this helps,

    Huske

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

Sidebar

Related Questions

Here's the situation, i want to have a user that can enter time on
Here's the problem....I have three components...A Page that contains a User Control and a
Here is my situation: I am using telerik with winform. I have a dataset
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here we go again, the old argument still arises... Would we better have a
I have a jquery bug and I've been looking for hours now, I can't
Here's the basic setup: I have a thin bar at the top of a
Here is my problem : I have a post controller with the action create.

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.