0

I have an ASP.NET Core MVC Web Application

I have a vertical navigation menu that is 50px wide by default, but the user has the option to expand it to 200px by clicking a button that I give them. This button updates the css classes to make the menu wide.

If the user expands it to 200px and then changes pages or causes a postback what are my options to persist that the user wants the menu at 200px.

I am aware that I can probably use cookies, but I only want to do that if I absolutely have to.

Blake Rivell
  • 13,105
  • 31
  • 115
  • 231

1 Answers1

1

You can store the width using localStorage, and get it when you load the page. (let's say, on jQuery's docuement ready). The best advantage of this is the fact that it will be persisted in the browser and you will not force the server to take the responsibility of remembering a view configuration.

Alberto Cruz
  • 137
  • 3
  • 9