Protected void page_load (Object sender, eventargs e) {If (! Ispostback) {session ["organcode"] = "Z" ;}for (INT I = 0; I <30000; I ++) {string zstr = session ["organcode"]. tostring (); If (string. isnullorempty (zstr) {label1.text = "session is null ";}}}
This is a good choice.
However, in some cases, for example, when a user clicks to go to another page, several sessions are displayed.
Change
Protected void page_load (Object sender, eventargs E)
{
// This. formview3.changemode (formviewmode. readonly );
If (! Ispostback)
{
Session ["organcode"] = "Z ";
}
String ZZ = session ["organcode"]. tostring ();
For (INT I = 0; I <30000; I ++)
{
String zstr = ZZ;
If (string. isnullorempty (zstr ))
{
Label1.text = "session is null ";
}
}
}
All done!
If the session is used improperly, other problems may occur even if the performance is not concerned. So it is better to get used to it.