Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 296169 - Last Review: August 15, 2001 - Revision: 1.0
PRB: Error "Session Object, ASP 0168" When You Assign Session Variables in JavaScript
This article was previously published under Q296169
When you try to assign a
Request.Form or
Request.QueryString variable to a Session variable in your JavaScript code, you receive the following error message on a computer that is running Microsoft Windows NT 4.0 (Internet Information Server 4.0):
Session object error 'ASP 0168 : 80004005'
Disallowed object use
/virdir/page.asp, line xx
An intrinsic object cannot be stored within the Session object.
You receive the following error message on a computer that is running Microsoft Windows 2000 (Internet Information Services 5.0):
Error Type:
Session object, ASP 0168 (0x80004005)
An intrinsic object cannot be stored within the Session object.
/virdir/page.asp, line 4
The values that
Request.Form and
Request.QueryString return are actually objects rather than strings. This problem occurs because you cannot store Active Server Pages (ASP) intrinsic objects in Session variables.
To resolve this problem, perform the necessary explicit casting by using the
.Item property of the
Request.Form (or
Request.QueryString) object.
For example, the following server-side JavaScript code produces this error:
<%
Session("test") = Request.Form("txt");
%>
To correct this code sample, add the
.Item property as follows:
<%
Session("test") = Request.Form("txt").Item;
%>
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
173317Â
(http://kbalertz.com/Feedback.aspx?kbNumber=173317/EN-US/
)
INFO: Active Server Pages' Request.Form and Request.QueryString Return Objects
APPLIES TO
- Microsoft Active Server Pages 4.0
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate