My asp.net application has a function that returns the HTML for the navigation menu for the user by getting it from a database
currently, I am storing the text in a session variable when the session begins and then use it to set the innerHtml of the navigation div on the on_load method.
The problem is that the pages now contain the
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPD..
with the value being 7000 characters long.
Is there any better way to do this or a different way to store and retrieve values without them being stored in the viewstate ?
The code is just this:
Session["menuHTML"] = (new NavMenu().GetMenuHTML());
navMenuDiv.InnerHtml = Session["menuHTML"].ToString();
The div is declared as
<div id="navMenuDiv" class="navMenuDiv" runat="server"></div>