Type Mismatch "session"

windows

Guest
Hi All,

I know this will probably sound so easy to you guys n gals on this forum, but for me wee Englishman it is mind boggling.

I have added a jscript pop up spell check using Word application dcom on to a email ASP form using A HREF. This is the exact line in the asp page:

<A HREF=http://www.htmlforums.com/archive/index.php/"JavaScript:OpenNewPopUpWindow('spell.asp','scrollbars=yes,resizable=yes,toolbar=no,menubar=no,locati on=no,status=no,width=500,height=400',document.taBody,'document.emailform.taBody','emailform')">CLICK TO SPELL CHECK</a>

The form pops up, but then errors out with: Type Mismatch "Session". I have enabled the Session check box in the IIS and also added the line: <enableSessionState="true"> in the spell asp page also to make sure.

I am completely baffled by this and would really appreciate anyone's suggestions. A free beer in London has your name on it..

BenThat seems more likely to be an error from your ASP code, not your javascript.

What's your code for that page look like (especially anything using the Session object)Hi Putts,

The code for the session bits is:

<form name=spellchkform action="<%= Request.ServerVariables("SCRIPT_NAME") %>" method="get">
<%
Const c_strFormName = "WordUtils"
Const wdSpellingNotInDictionary = 1
Dim blnisOK

if session("WordsCheckList") = "" then
session("WordsCheckList") = request("text")
else
session("WordsCheckList") = session("WordsCheckList")
end if

if session("WordsToCheck") = "" then
session("WordsToCheck") = request("text")
else
session("WordsToCheck") = session("WordsToCheck")
end if

if session("wordsToCheck") = "" then

Response.Write"<BR><BR><BLOCKQUOTE>A text string is required.<BR><BR>" & Chr(10) & _
"<A HREF=http://www.htmlforums.com/archive/index.php/""javascript:window.close()"">Close Window</A>"

else

if session("objSelected") = "" then
session("objSelected") = request("objselected")
else
session("objSelected") = session("objSelected")
end if
if session("frmname") = "" then
session("frmname") = request("frmname")
else
session("frmname") = session("frmname")
end if
act = LCase(Request("action"))

if act = "" then
DoDefault
else
if act = "change" then
ChangeWord request("badword"), session("WordsToCheck")
elseif act = "change all" then
ChangeAllWords request("badword"), session("wordsToCheck")
elseif act = "ignore" then
IgnoreWord request("badword")
elseif act = "ignore all" then
IngoreAll request("badword"), session("WordsToCheck")
elseif act = "close" then
CloseAll
else
DoDefault
end if
end if




It moans about the line in red, but I think it is the first line using session, so would moan about them all after.

Would you like me to mail you the complete two pages?

Thanks again,

BenI didn't see any variable being pass in querystring of spell.asp.

if session("WordsCheckList") = "" then
session("WordsCheckList") = request("text")

If it blank then do this
session("WordsCheckList") = request("text")

To make things less complicated. I wouldn't use session for this operation. Just my opinion.

<!-- m --><a class="postlink" href="http://www.ex-designz.net/codemanager/default.asp">http://www.ex-designz.net/codemanager/default.asp</a><!-- m -->
DexterCheers for your comments Dexterz..

Your opinions count, what would you suggest as an alternative to session?

Bendexter's recommendation is correct but I don't think it helps with your exact problem.

the line in red should, in no way, cause any error to raise.

Just to verify that Session state is enabled....

You've gone into IIS...
Right clicked on the Virtual Directory in question....
Clicked the Configuration button on the main properties page....
Gone to the Options tab in the App Configuration window...
Made sure that Session State is checked.Putts is correct. It is like your comparing an object to a string. Can we see the assignment of the session variable?

Also the correct syntax for enabling /disabling is

<%@EnableSessionState="True"%>Thanks all,

I managed to work it by fluke...

it was the jscript reference line, which was causing the issue:

document.taBody

now reads:

document.emailform.taBody.value

It worked after that.

P.S. The session state was changed in the IIS as you mentioned. cheers.

BenI'm glad you figured it out BC. ASP is fun and you just need to practice/play a lot and little patience to get things work.

Alternative to Session Object is to use Stored Procedure in your DB.

Dexter
MY ASP Code Bank (<!-- m --><a class="postlink" href="http://www.ex-designz.net/codemanager/default.asp">http://www.ex-designz.net/codemanager/default.asp</a><!-- m -->)
 
Back
Top