Click here to Skip to main content
15,889,462 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionSSL Pin
DBNashville11-Jan-07 4:23
DBNashville11-Jan-07 4:23 
Questionasp.net validations Pin
P Bhasker11-Jan-07 3:42
P Bhasker11-Jan-07 3:42 
AnswerRe: asp.net validations Pin
_AK_11-Jan-07 3:45
_AK_11-Jan-07 3:45 
GeneralRe: asp.net validations Pin
P Bhasker11-Jan-07 3:52
P Bhasker11-Jan-07 3:52 
GeneralRe: asp.net validations Pin
sanaziuse11-Jan-07 4:07
sanaziuse11-Jan-07 4:07 
Questionhow to use application state and session state Pin
Rmesh11-Jan-07 2:41
Rmesh11-Jan-07 2:41 
AnswerRe: how to use application state and session state Pin
_AK_11-Jan-07 2:50
_AK_11-Jan-07 2:50 
AnswerRe: how to use application state and session state [modified] Pin
Skanless11-Jan-07 9:32
Skanless11-Jan-07 9:32 
I am new ,also, to both ASP and ASP.net and in both instances I am self taught. Nonetheless, let me try to explain what is and the usage of both session and application state. Application state refers to any data that you might want to share amongst (all)users while session state maintains the state for individual user. While values stored in the application state will remain until the application is restarted or deleted, session state values are removed and discared as soon as the user ends his/her session(either by logging off or closing the browser). A typical example of session state is a counter on a website which tells you "you are the Xth person visitng our site (whereby X respresent the number of visitors to the site since the application started). While session state will tell you "You're logged in as such "username" and have been on for the past X amount of minutes (per se).

To set/capture and access the values contained in specific state the following syntax can be used.

Session state (syntax)

Session["MySessionVar"] = "MyValue";
/*where by my value can be anything u want to use be it username, password(not advisable), userPreferences....and so on. */

//then you can assign it to a variable which you can use to access and print the value of Session value(s)

SessionAlias = Session["MySessionVar"];

//To output the value contained in your session can be
//written as (lets say used the login name as the session
//value).

Response.Write("You are currently logged-in as " + SessionAlias);

The application state (syntax) is quite same as the session syntax. The only difference is that instead of using keyword "Session" you use "Application".

I must admit that this is a very elementary explantion but I sincerely hope that it helps you to better understand the concept. Not to long ago I was exactly where you are now in learning ASP and ASP.net and though I have advanced somewhat, I still have a long way to go. The best way to learn these concepts and ideologies are to practice writing them. However if you are unfamiliar with their existence then there will be no inclination to learn them. As a novice programmer I've found out the best way to learn is to read as much source code as you can and anything that captures your attention you should write it down then find a season programmer and start questioning him away. Hopem this helps.

PS: I will stand corrected should any of the readers find my explanation is erroneous.




-- modified at 15:38 Thursday 11th January, 2007

Skan
Coding makes the world go round!!!

QuestionCustomize the Calendar Control Pin
RX Maverick11-Jan-07 2:21
RX Maverick11-Jan-07 2:21 
AnswerRe: Customize the Calendar Control Pin
Mike Ellison11-Jan-07 3:52
Mike Ellison11-Jan-07 3:52 
GeneralRe: Customize the Calendar Control Pin
RX Maverick16-Jan-07 4:08
RX Maverick16-Jan-07 4:08 
GeneralRe: Customize the Calendar Control Pin
Mike Ellison16-Jan-07 7:19
Mike Ellison16-Jan-07 7:19 
QuestionDisplaying a Image from a MySQL db Pin
tmoney10111-Jan-07 1:24
tmoney10111-Jan-07 1:24 
AnswerRe: Displaying a Image from a MySQL db Pin
SICStus11-Jan-07 4:39
SICStus11-Jan-07 4:39 
GeneralRe: Displaying a Image from a MySQL db Pin
tmoney10111-Jan-07 11:21
tmoney10111-Jan-07 11:21 
GeneralRe: Displaying a Image from a MySQL db Pin
SICStus11-Jan-07 23:54
SICStus11-Jan-07 23:54 
QuestionIE Tree View Web Control for ASP.NET 1.1 Pin
tonsum11-Jan-07 0:39
tonsum11-Jan-07 0:39 
AnswerRe: IE Tree View Web Control for ASP.NET 1.1 Pin
Skanless11-Jan-07 9:47
Skanless11-Jan-07 9:47 
GeneralRe: IE Tree View Web Control for ASP.NET 1.1 Pin
tonsum11-Jan-07 18:34
tonsum11-Jan-07 18:34 
QuestionConsideration for Data Acess layer in Asp.Net Pin
King Shez11-Jan-07 0:03
King Shez11-Jan-07 0:03 
AnswerRe: Consideration for Data Acess layer in Asp.Net Pin
Mike Ellison11-Jan-07 3:54
Mike Ellison11-Jan-07 3:54 
QuestionEdit gridview Pin
gonmor10-Jan-07 23:37
gonmor10-Jan-07 23:37 
AnswerRe: registration and gac intallation Pin
Pete O'Hanlon11-Jan-07 0:11
mvePete O'Hanlon11-Jan-07 0:11 
AnswerRe: regasm d:\Aleem\DSOControl1\DSOControl1.dll Pin
Pete O'Hanlon11-Jan-07 0:11
mvePete O'Hanlon11-Jan-07 0:11 
GeneralRe: regasm d:\Aleem\DSOControl1\DSOControl1.dll Pin
gonmor11-Jan-07 23:14
gonmor11-Jan-07 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.