473,466 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Losing Session variables with enctype="multipart/form-data"

6 New Member
Hello
I'm using ASP.NET 2003 on Windows XP SP2. I'm providing a web form that allows users to upload a document (xls, images, doc, pdf, etc) to the server. This part works fine, but after the form posts to the server, all of my session variables are cleared out. The Session.SessionID is not affected, but the rest are blank. How do i keep these values populated while using this upload method?

[HTML]
<form name="form1" runat="server" enctype="multipart/form-data" ID="Form1">
.
.
</form>
[/HTML]

I write the session variables to the screen when it does it's initial load (and the session variables are correct), and after the form is submitted (this is when i lose my values).
Aug 2 '07 #1
2 3098
jhardman
3,406 Recognized Expert Specialist
Hello
I'm using ASP.NET 2003 on Windows XP SP2. I'm providing a web form that allows users to upload a document (xls, images, doc, pdf, etc) to the server. This part works fine, but after the form posts to the server, all of my session variables are cleared out. The Session.SessionID is not affected, but the rest are blank. How do i keep these values populated while using this upload method?

[HTML]
<form name="form1" runat="server" enctype="multipart/form-data" ID="Form1">
.
.
</form>
[/HTML]

I write the session variables to the screen when it does it's initial load (and the session variables are correct), and after the form is submitted (this is when i lose my values).
and if you change the enctype you lose the file upload but keep the session variables? Gee, I don't know what to tell you. Would it be convenient to switch to cookies?

I'll post a link from the .NET forum in case they have a better idea.

Jared
Aug 3 '07 #2
Frinavale
9,735 Recognized Expert Moderator Expert
Hello
I'm using ASP.NET 2003 on Windows XP SP2. I'm providing a web form that allows users to upload a document (xls, images, doc, pdf, etc) to the server. This part works fine, but after the form posts to the server, all of my session variables are cleared out. The Session.SessionID is not affected, but the rest are blank. How do i keep these values populated while using this upload method?

[HTML]
<form name="form1" runat="server" enctype="multipart/form-data" ID="Form1">
.
.
</form>
[/HTML]

I write the session variables to the screen when it does it's initial load (and the session variables are correct), and after the form is submitted (this is when i lose my values).
What type of Session are you using?
If you are saving the file into Session, and you are using InProc, this could possibly increase the size aspnet_wp.exe (where your session objects are stored) to the point where the garbage collector recycles it.
Aug 3 '07 #3

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

Similar topics

3
by: Arnaldo Martinez | last post by:
Hi, friends: I have an ASP page where an user enter a value and click the submit button. I want this value to be transfer to a session("temp") within the same page where I want to call it back...
2
by: Jack | last post by:
I have a form that has few text boxes to input. However, after saving, if the user comes back to the same form, then the input boxes should be locked. I would like to know whether this can be...
5
by: John Oliver | last post by:
I'd like the email produced by FormMail to show a specific From: address rather than postmaster@server.host.name Googling isn't helping me... not sure what to look for :-( -- * John Oliver ...
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
10
by: BBM | last post by:
Hi, I have been developing with C# User Controls and occasionally have a problem where I "lose" a control from the design surface of the User Control. The controls that I am using to build my...
3
by: Peter Theill | last post by:
Hi, I'm trying to include the content of a request into an Xml document: if (System.Web.HttpContext.Current.Session != null) { XmlDocument d = new XmlDocument(); d.Load(new...
0
by: bolinc | last post by:
Can someone tell me why this isn't working? <Script language="JavaScript"><!--// var bJavaEnabled = Boolean(clientInformation.javaEnabled()); if (bJavaEnabled){ document.write('<form...
3
by: G | last post by:
Hello, I have a c# ASPX file, and a Code Behind file. This file has contents POSTED to it, around 15 form fields. Rather than manually catch each Request.Form - is there an easy way to...
9
by: Anil Gupte | last post by:
I have a MDI Parent Child set of forms FormContainer --MDIParent FormStart --MDIChild FormMain-->MDIChild FormSliceInfo-->MDIChild I use the following in the beginning of FomrContainer ...
6
by: Deano | last post by:
Every once in a while I modify one particular form (could be anything from adding code to tweaking properties as far as I can see) and upon loading I get; "You can't assign a value to this...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.