I need to clear an item from System.Web.HttpSessionStateBase.Session from a view.
This is needed as we have fields that are cleared only when navigate to different page.
When I use sample below it shows an error- Cannot implicitly convert type void to object.

Code that I currently have:

$('.navigate-to-page').on('click', function () {

   // @Session.Remove("ItemToRemoveKey");


Note: Does not work with ViewData or ViewBag.

Related posts

Recent Viewed