TAILIEUCHUNG - ASP.NET 4 Unleased - p 122

Sau khi bạn mở trang trong Ví dụ 26,28, nếu bạn nhấp vào liên kết Đăng nhập, bạn sẽ được chuyển hướng đến trang đăng nhập. Nếu bạn nhập tên người dùng hợp lệ và mật khẩu, bạn sẽ được chuyển trở lại trang . Việc kiểm soát LoginStatus hỗ trợ các thuộc tính sau: | 1184 CHAPTER 26 Using the Login Controls LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD html xmlns http 1999 xhtml head id Head1 runat server title Show LoginStatus title head body form id form1 runat server div asp LoginStatus id LoginStatus1 Runat server hr Additional information is available to registered users. Log in to view the additional information. div form body html After you open the page in Listing if you click the Login link you are redirected to the Login page. If you enter a valid username and password you are redirected back to the page. The LoginStatus control supports the following properties LoginImageUrl Enables you to specify an image for the Login link. LoginText Enables you to specify the text for the Login link. LogoutAction Enables you to control what happens when the Logout link is clicked. Possible values are Redirect RedirectToLoginPage and Refresh. LogoutImageUrl Enables you to specify an image for the Logout link. LogoutPageUrl Enables you to specify a page to which the user is redirected when the user logs out. This property is ignored unless the LogoutAction property is set to the value Redirect. LogoutText Enables you to specify the text for the Logout link. From the Library of Wow eBook Using the LoginName Control 1185 The LoginStatus control also supports the following two events LoggingOut Raised before the user is logged out. LoggedOut Raised after the user is logged out. Using the LoginName Control The LoginName control displays the current user s registered username. If the current user is not authenticated the LoginName control renders nothing. The page in Listing contains both a LoginName and LoginStatus control. LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD .