|
-
Sep 10th, 2003, 10:20 AM
#1
Thread Starter
Hyperactive Member
Setting session variable thr. javascript
hi all,
is there any way to set Session variable from javascript in asp.
A man with nothing to live for has everything to fight for...
-
Sep 10th, 2003, 01:37 PM
#2
No - javascript is client side; ASP is server side.
What you could do though, is use javascript to set a hidden variable's value & post the page back to itself, setting the session variable then.
Code:
<%
Dim MyValue
MyValue = Request.Form("hidValue")
%>
<html>
<head>
<title>Blah</title>
<script language="javascript" type="text/javascript">
function postBack(myValue) {
var theForm = document.frmBlah;
theForm.hidValue.value = myValue;
theForm.submit();
}
</script>
</head>
<body>
<form id="frmBlah" name="frmBlah" method="post">
<input type="hidden" id="hidValue" name="hidValue">
</form>
</body>
</html>
-
Sep 10th, 2003, 02:42 PM
#3
Frenzied Member
Originally posted by axion_sa
No - javascript is client side; ASP is server side.
Javascript could be a server side script as weel
-
Sep 10th, 2003, 02:49 PM
#4
Originally posted by andreys
Javascript could be a server side script as weel
Granted, but I think the context here was client side - could be wrong
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|