On the preservation of identity information under asp.net (iii.)
Source: Internet
Author: User
asp.net the first two sections describe my understanding of the preservation of authentication information, no one to see the brother in turn read about the status of ASP.net under the preservation of Information (ii), on the ASP.net of Identity information preservation (i).
Today I want to say Server.Transfer, in the last two sections, we rely on the Server.Transfer method to pass the saved user information to the next page. But in practical applications I found the drawbacks of applying the previous two articles.
Server.Transfer () method can only pass the value between two pages in the application, but it cannot save and pass the value smoothly when the third page is added.
For example: There is a page a.aspx (for Login page), B.aspx (information summary page), c.aspx (individual information page) in a page we perform authentication and save in This.login_user attribute and then Server.Transfer ( b.aspx), the value is passed smoothly to the B page and then Server.Transfer in the B page (c.aspx); Theoretically, the value should be delivered to the C page, but we'll pass it on the C page.
b ls= (b) context.handler;//Read page face value
Userinfo=ls. login_user;//Read user information value
Method is unable to populate the UserInfo variable, why?
Dude, got a morning to finally understand that the context is not in the third page to continue to save the information inside, we can not use the session as the context, so we should be in the B page should be executed again this.login_user= UserInfo so that the value is added to the context again and then Server.Transfer ();
The above is a little humble opinion of the younger brother, willing to take out and discuss. If there is a more profound understanding of the expert
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service