asp error 0197

Hi,
I am writing an ASP application in Javascript.When I try to create Application or Session variables I keep getting this
error message:
Disallowed object use. Cannot add object with apartment model behavior to the application intrinsic object.

<%
.
.
var strName=Request.Form("txtUser");
Session("user")=strName;

or getting records from a database:

var strName=rset("User");
Application("username")=strName;
.
%>
It only allows me to assign literal constants to the session or app variables, which is totally useless to me.
Interestingly the above code works fine in VBscript (changing the syntax of course)
What causes the problem?
Is there any workaround?
Thanks

Comments

  • : Hi,
    : I am writing an ASP application in Javascript.When I try to create Application or Session variables I keep getting this
    : error message:
    : Disallowed object use. Cannot add object with apartment model behavior to the application intrinsic object.
    :
    : <%
    : .
    : .
    : var strName=Request.Form("txtUser");
    : Session("user")=strName;
    :
    : or getting records from a database:
    :
    : var strName=rset("User");
    : Application("username")=strName;
    : .
    : %>
    : It only allows me to assign literal constants to the session or app variables, which is totally useless to me.
    : Interestingly the above code works fine in VBscript (changing the syntax of course)
    : What causes the problem?
    : Is there any workaround?
    : Thanks
    :
    I found this article on MS KB:
    http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q296/1/69.asp&NoWebContent=1

    Perhaps you need to modify the code to:
    var strName=Request.Form("txtUser").item;
    Session("user")=strName;


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion