Global Directory
Global Directory
EXPLORE OUR SITES
London Stock Exchange Group
LSEG Data & Analytics
MyAccount
LSEG Perspectives
London Stock Exchange
FTSE Russell
LCH
Contact Us
Home
TR Internal
How should we keep data between pages?
Emanuel Balan
For example if you fill a search inputs and after that, you try to navigate through the TOC, the page will be reloaded and you lose the data.
We keep and reset the data through cookies and JQuery.
Any better solution?
Find more posts tagged with
refinitiv-internal
Accepted answers
All comments
Ryan Morlok
If your users are going to be navigating through the TOC by clicking links, then storing the form data in a cookie is probably the best option. Clicking the link would normally be a GET request{1}, and the only reasonable way to communicate the form information will be with cookies.
If you are doing POSTs to the server (as is the case in ASP.NET non-MVC for some controls), then you the form information would also be included in the POST and you could repopulate it on the server's rendering of the page.
A final option would be to make that TOC navigation ajax driven, reloading the TOC information as the user navigates. In this case your forms could just stay in place with the data intact. The downside of this is that you break impressibility of the pages unless you use the [History API][1] (only available on modern browsers), [shebang URLs][2], or some library that will do either based on browser capabilities.
{1} unless you are doing something fancy with listening on the click event and doing a POST yourself. This is what ASP.NET does for some controls.
[1]:
https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
[2]:
http://stackoverflow.com/questions/5930237/should-i-use-hashbang-shebang
Quick Links
All Forums
Recent Questions
Terms of use
Privacy & Cookie Statement
Cookies settings
Do not sell my info
Whistleblowing
UK Bribery Act
Modern Slavery Act