473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 3562
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

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

Similar topics

4
by: Laura | last post by:
Help. Below is my code. Getting Type mismatch error on the noted line. I'm trying to send an array (aryNewD) with 4 columns and x rows to a function to save all the array info into a SQL Server...
2
by: Tom Jordan | last post by:
Hi all, I've thrown together a simple shoppng cart and basket, but I occasionally get a type mismatch error on the basket. For example: Microsoft VBScript runtime error '800a000d' Type...
3
by: Savas Ates | last post by:
i have 3 columns in sql server .. all of them are numeric value when a user enter my site i take the value of userid (numeric one) i assign it as session("userid ") after a query i take 2...
1
by: LJgrnl | last post by:
I've got a type mismatch error that's driving me nutty. Variable blnNoData has the initial value False. If a recordset comes back empty (both .EOF and ..BOF are true) then blnNoData is set to...
7
by: Jack | last post by:
Hi, I have posted this problem before. Apprently, the suggestion took care of the problem. However, still I am getting the above error message. I am using a session variable to transfer a value...
1
by: s_m_b | last post by:
I am having a problem with a page that creates a treeview from a database, by reloading itself on each request for a new folder to be explored. The problem revolves around using an array to store...
4
by: Mike | last post by:
I am getting a type mismatch error when I do a bulk insert. ---Begin Error Msg--- Server: Msg 4864, Level 16, State 1, Line 1 Bulk insert data conversion error (type mismatch) for row 1, column...
3
by: Snow | last post by:
Hello: I have Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: '' The error happened at this line: if session("systemIdCount" & arrSystems(iLoop)) 0 The code like this:
5
by: daniel.hedz | last post by:
I am generating a usercontrol dynamically successfully, but when I try to find that usercontrol I get a type mismatch. This is what I am doing: //Loading my usercontrol...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.