I have a Layout
page which sets up the list of Projects in the application using Telerik's ComboBox
as shown. The combobox
allows user to select a project he/she wants to work on.
Once a selection is made, I want all subsequent actions in the application should correspond to the selected Project. I can preserve the Project information in a Session
but then if user chooses to open this in a new tab and in 2nd tab users switches to a different Project and comes back to the first tab and refreshes the page then the session information (Project) would have changed which will create issues in my application.
So, what is the best way for me to persist Project information of the Layout.cshtml
controls so that I can use it in my application such that every page that is rendered uses the currently/correctly selected values.
Tempdata
/ QueryStrings
came to my mind but i don't know whether they will be reasonable solution to my problem. If yes, then how should I use them generically (specially querystrings
) without complicating my solution?
localStroage
and sessionStorage
also seems like relevant solutions but then how do I use them in scenario where user opens a new tab from existing page? How will the Project # will persist on the newly opened page/window/tab?