Home > Net >  For bosses to help see ASP.NET, questions about Session spread value
For bosses to help see ASP.NET, questions about Session spread value

Time:11-22


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 perform

CodePudding 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:

reference 1/f, guiyang horse Ma Shanfu plugging waterproof engineering professional maintenance of swimming pool response:
the breakpoint see Session [" Mz "]=this. Label1. Text. The Trim (); Have to perform to

Perform arrived, he said the session is empty

CodePudding user response:

Is to jump to that, but I really superfluous this code

CodePudding user response:

Look at the views of the great god

CodePudding user response:

You look at what is null or ""

CodePudding user response:

Is that the null

CodePudding user response:

Men, I know the problem, I wrote a Session where the authentication code, Abandon, all Session be cleared

CodePudding user response:

Have you brothers in Shanghai to discuss together

CodePudding user response:

Is this webform?
  • Related