Session in Javascript
<script type=”text/javascript”>
//To set Session
function Setsession() {
if (window.sessionStorage) {
sessionStorage.setItem(“key1″, document.getElementById(‘<%= Write.ClientID %>’).value);
}
}
if (window.sessionStorage) {
sessionStorage.setItem(“key1″, document.getElementById(‘<%= Write.ClientID %>’).value);
}
}
//To get Session
function GetSession() {
if (window.sessionStorage) {
document.getElementById(‘<%= Get.ClientID %>’).value = sessionStorage.getItem(“key1″);
}
}
</script>
To get Session Value using javascript
<script type=”text/javascript”>
var session = '<%= Session["VALUE"] %>';
</script>
if (window.sessionStorage) {
document.getElementById(‘<%= Get.ClientID %>’).value = sessionStorage.getItem(“key1″);
}
}
</script>
To get Session Value using javascript
<script type=”text/javascript”>
var session = '<%= Session["VALUE"] %>';
</script>
No comments:
Post a Comment