I'w working on a project in classic ASP and I want to add, for example, some users for a temporary list and when I submit the form, this data will be save to DB.
I know how to work with this in asp.net, but not in classic asp.
Is it possible to create lists of users, for example, and manage this in a session?
thanks!
In ASP.NET session is a state that is used to store and retrieve values of a user. It helps to identify requests from the same browser during a time period (session). It is used to store value for the particular time session. By default, ASP.NET session state is enabled for all ASP.NET applications.
yesa, you can use this, or the application state. one thing do note, you cant save objects in it, so you'll need to do some serialization if you want to store any complex things in it.
Session("username")="Donald Duck"
Session("age")=50
http://www.w3schools.com/ASP/asp_sessions.asp
OPINION
You do have a couple of options of which a session is not one I would recommend. Just using form posting would be preferable just because of all the potential overhead with sessions in general. The most you would generally want to use them for is login data storage for a user logged into a site.
Not classic asp but good to know in all future endeavors with Sessions http://www.aspnet101.com/2010/10/asp-net-session-state-best-practices/
Answer http://www.w3schools.com/ASP/asp_sessions.asp
//adding values to a session CSV
//Yes I know these are not vbscript comments
//but I cant use vb comments
Session("someString") = "Value1,Value2,Value3"
//Retrieving a value from a session
Dim valsArr = Split(Session("someString"),",")
//returning all content in a session object
dim i
For Each i in Session.Contents
Response.Write(i & " ")
Next
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With