tailieunhanh - aspnet sample_part5

Với Chỉ thị Bạn có thể thấy được lợi ích của nhà nước xem đã. Nhưng mà là tất cả những thông tin được lưu trữ? Các trang duy trì trạng thái xem bằng cách mã hóa các dữ liệu trong một lĩnh vực biểu mẫu ẩn. | Working With Directives You can see the benefits of view state already. But where is all that information stored pages maintain view state by encrypting the data within a hidden form field. View the source of the page after you ve submitted the form and look for the following code input type hidden name __VIEWSTATE value dDwtMTcyOTAyO DAwNzt0PDtsPGk8Mj47PjtsPHQ8O2w8aTwzPjs O2w8dDxwPGw8aW5uZXJodG 1sOz47bDxIZWxsbyBXb3JsZDs Pjs7Pjs Pjs Pjs d2wl7GlhgweO9LlUihS FaGxk6t4 This is a standard HTML hidden form field with the value set to the encrypted data from the form element. As soon as you submit the form for processing all information relevant to the view state of the page is stored within this hidden form field. View state is enabled for every page by default. If you do not intend to use view state you can turn it off which will result in a slight performance gain in your pages. To do this set the EnableViewState property of the Page directive to false @ Page EnableViewState False Speaking of directives it s time we took a closer look at these curious beasts Working With Directives For the most part pages resemble traditional HTML pages with a few additions. In essence just using an extension like .aspx on an HTML file will make the .NET Framework process the page. However before you can work with certain more advanced features you will need to know how to use directives. We ve already talked a little about directives and what they can do earlier in this chapter. You learned that directives control how a page is created specify settings when navigating between pages aid in finding errors and allow you to import advanced functionality to use within your code. Three of the most commonly used directives are Page Defines page-specific attributes for the page such as the language used. Import Makes functionality defined elsewhere available in a page through the use of namespaces. You will become very familiar with this directive as you progress .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.