The first page:
If (Session/" name "==null)
{
This. Label1. Text="kiss, please login";
}
The else
{
This. Label1. Text=Session/" name "as the string;
}
//the name to the personal information page
Session [" Mz "]=this. Label1. Text. The Trim ();
The second page:
If (Session [" Mz "]==null)
{
Enclosing Label1. Text="* *";
}
The else
{
This. Label1. Text=Session (" Mz ") as a string;
}
I am here why the value of the second page is empty?
This configuration also
& lt; System. Web>
& lt; SessionState mode="InProc customProvider"="DefaultSessionProvider & gt;"
& lt; Providers>
& lt; Add name="DefaultSessionProvider" type="System. Web. Will. DefaultSessionStateProvider, System. Web. Will, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31 bf3856ad364e35" connectionStringName="DefaultConnection"/& gt;
& lt;/providers>
& lt;/sessionState>
& lt;/system. Web>
CodePudding user response:
Breakpoint see Session [" Mz "]=this. Label1. Text. The Trim (); Have to performCodePudding user response:
Are you sure is from the first page jump to the second page?In addition, why do you want to make a Session/" Mz "? If have login successful, the Session/" name "will save the user name, can use the Session to which page/" name"
CodePudding user response: