469,307 Members | 1,926 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

Type Mismatch: Session error


Im currently updating our email sending functionality of our application. The website is written in classic asp and all codes are really a mess. anyway my problem is that our current process is to use the URL to pass variables from page to page, but i've found out that the max limit is about 2000 characters, and one value we need to pass is the text found in a text area. But the value to be pass is more than 2000 characters which create URL error because of the limit. I've tried using session instead to store the value of the text area but when i try to incorporate the code for session in the vbscript for btnsave_onclick sub, i've got a Type Mismatch: Session error. Do you know the cause of this? below is the code im using:

Expand|Select|Wrap|Line Numbers
  1. Sub btnSave_onclick
  2.     sEventID = frmSave.hdnEventIDNumVal.value
  3.     'sEBody = escape(CStr(document.getElementById("txtMailBody").outerText)) '--Remove because of URL limit
  4.     sESender = escape(CStr(document.getElementById("txtMailSender").value)) '--[JCD,PIIWR05-FR002]
  5.     Session("SesEmailBody") = escape(CStr(document.getElementById("txtMailBody").outerText))  '--Session to replace URL variable.
  6.     window.location.href = "SaveMemo.asp?EventIDNum=" & sEventID & "&page=" & iPage & "&EmailSender=" & sESender 
  7.     '& "&EmailBody=" & sEBody  '--Remove because of URL limit
  8. End Sub
Note: the update of the database is found in SaveMemo.asp

Any suggestion on how to pass the value of the text area (txtMailBody) to savememo.asp?

I would really appreciate a quick response! Thanks!
Oct 11 '07 #1
1 3255
3,406 Expert 2GB

The session variables (and for that matter, all of the ASP code) can only be accessed while the page is being executed on the server. Any ASP code is dead after the user gets it.

Why aren't you sending this via form? That's the standard way to do it, and a lot simpler than what you have here.

Oct 14 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Tom Jordan | last post: by
1 post views Thread by LJgrnl | last post: by
5 posts views Thread by daniel.hedz | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.