Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Viewstate only exists within the context of the current form (It is contained within a hidden input field). Which means that Viewstate alone will not help (any time you get the page - not post - it will have a new Viewstate). There are a few options though. The easiest of which is using Session to store the context of the search queries (date, date range, client, etc.). This exists on the server side and can be used when loading the page. Another way of maintaining your search queries is to utilize how browsers maintain history. You can add hash (#) codes to the end of your url that can then be read by javascript. The Backbone.js routing and history functionality work this way. However, this is a very complex solution as it is typically meant for asynchronous requests. Both of these possible options have some caveats (Session lives for the life of the session cookie) but if you remove Viewstate (Page.EnableViewState = false) you will have a much smaller request/response network footprint.</p> <p>Here's some Backbone routing code:</p> <pre><code>$(document).ready(function() { Backbone.history.start(); }); // create some routes var DynamicWorkspace = Backbone.Router.extend({ routes: { "search/:date": "search", "search/:date/:range": "search", "search/:date/:range/:client": "search" }, search: function(date, range, client) { // make a request to your server with the queries } }); var dynamicRouter = new DynamicWorkspace; var currentDate = ''; var currentRange = ''; var currentClient = ''; // call this via javascript from a page element function setDate(value) { currentDate = value; return updateNavigation(); } // call this via javascript from a page element function setDateRange(value) { currentRange = value; return updateNavigation(); } // call this via javascript from a page element function setClient(value) { currentClient = value; return updateNavigation(); } function updateNavigation() { // change the browser url to our known route dynamicRouter.navigate('search/' + currentDate + '/' + currentRange + '/' + currentClient, true); return false; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload