Session variable mainly use for global value. If you want to value make as global then store that value as session variable & then use that value in different pages....
//Source.aspx.cs
Drag One Button In Window Form & Named “BtnNext”….
privatevoid
BtnNext_Click(object sender, System.EventArgs e)
{ //Drag Two TextBox In Window
From & Named “TxtUserName” & “TxtSystemName”... //Store Values In Two Session
Variable From The TextBoxes...
//Destination.aspx.cs Drag Two Labels In Window
Form Named “LblUName” & “LblSName”…
privatevoid
Page_Load(object sender, System.EventArgs e)
{ //Store Session Variables
Value In The Lables….
LblUName.Text=Session["UserName"].ToString();
LblSName.Text=Session["SystemName"].ToString();
//Remove Both Session
Variable... Session.Remove("UserName"); Session.Remove("SystemName");
}
0 comments
Comments
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
Join the conversation! Your thoughts help the community grow.