473,385 Members | 2,044 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,385 software developers and data experts.

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

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 3094
jhardman
3,406 Expert 2GB
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 Expert Mod 8TB
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.