TAILIEUCHUNG - ASP.NET 4 Unleased - p 134

Maintaining Application State LISTING The numberOfVisits property defined in Listing includes the allowAnonymous attribute. The web configuration file also enables Forms authentication. When Forms authentication is enabled, and you don’t log in, you are an anonymous user. The page in Listing illustrates how you modify a Profile property when Anonymous Identification is enabled. LISTING void | 1304 CHAPTER 28 Maintaining Application State LISTING xml version configuration authentication mode Forms anonymousIdentification enabled true profile properties add name numberOfVisits type Int32 defaultValue 0 allowAnonymous true properties profile configuration The numberOfVisits property defined in Listing includes the allowAnonymous attribute. The web configuration file also enables Forms authentication. When Forms authentication is enabled and you don t log in you are an anonymous user. The page in Listing illustrates how you modify a Profile property when Anonymous Identification is enabled. LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD script runat server void Page_PreRender From the Library of Wow eBook Using Profiles 1305 protected void btnLogin_Click object sender EventArgs e Bob false protected void btnLogout_Click object sender EventArgs e script html xmlns http 1999 xhtml head id Head1 runat server title Show Anonymous Identification title head body form id form1 runat server div User Name asp Label id lblUserName Runat server br Is Anonymous asp Label id lblIsAnonymous Runat server br Number Of Visits asp Label id lblNumberOfVisits Runat server hr asp Button id btnReload Text Reload Runat server asp Button id btnLogin Text Login OnClick btnLogin_Click 28 From the Library of Wow eBook 1306 CHAPTER 28 Maintaining Application State Runat server asp Button id btnLogout Text Logout OnClick btnLogout_Click Runat server div form body html Each time that you request the page in Listing .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.