472,141 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

Type Mismatch: Session error

Hi,

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 3438
jhardman
3,406 Expert 2GB
Fanatic,

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.

Jared
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.