This section describes how to pass values on ASP. NET pages. The example in this article is very simple. It only contains one text box and several buttons. When a button is clicked, the strings in the text box will be passed to another page in different ways.
SessionVariable
SessionVariable value passing is the most common method. This method not only transfers values to the next page, but also cross-transmits values to multiple pagesSessionThe value of the variable disappears after being removed.
Protectedvoid
AvailableSessionAdd method
Session["Name"] = TxtName. Text;
AvailableSession. Add ("Name", TxtName. Text );
Session["Email"] = TxtEmail. Text;
AvailableSession. Add ("Email", TxtEmail. Text );
Protectedvoid
Session["Name"]. ToString ();
Session["Email"]. ToString ();
Clear after useSessionValue in
SessionTransmits numeric values. This method consumes server resources and is used as few as possible.