Member_2_7964962_1
asked on
How to retreive Local Storage Key value
I am trying to retrieve the Local Storage Value from a browser. The value is stored in the browser.
Once I obtain the localStorage value I will need to access this value form code behind in asp.net
<asp:HiddenField ID="hdnUserName" runat="server" />
<asp:HiddenField ID="HiddenField1" runat="server" />
<script>
function load() {
hdnUserName = window.localStorage.getItem("PortalLoginApp.userName");
localStorage.getItem(localStorage.Key);
}
//}
window.onload = load;
</script>
Once I obtain the localStorage value I will need to access this value form code behind in asp.net
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have a question. in the browser window for the cookie there is a Name and a Value column. Should I place the word Value in place of PortalLoginApp below like. var userName = window.localStorage.getIte m("Value.u serName");
var userName = window.localStorage.getIte m("PortalL oginApp.us erName");
var userName = window.localStorage.getIte
ASKER
Your suggestions worked.
ASKER