Hi i want to access the sessionStorage.getitem value in my Layout.cshtml.page.First i set value for sessionStoage.Set item in index page.If i move from one page to another page and again i moved to pervious page by clicking home button this session value is not maintained.
Index page
function GetAll() {
sessionStorage.setItem("CommonTypeval", typeval);
}
My code
var elecval = Session["CommonTypeval"].ToString(); ;
Any one understand my issue and help me to resolve this

Sachin SinghRank #66 · 26.2K reputationPosted Nov 8, 2020, 11:46 PM EST
Sneha KRank #2,496 · 563 reputationPosted Nov 8, 2020, 11:58 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 9, 2020, 1:32 AM EST
Sneha KRank #2,496 · 563 reputationPosted Nov 9, 2020, 3:54 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 9, 2020, 5:29 AM EST
Ashutosh GuptaRank #805 · 2.9K reputationPosted Nov 9, 2020, 7:37 AM EST
you can use
asp:HiddenFieldafter changed
localstorageorsessionStorageyou fill hidden field and use in code behind.