TAILIEUCHUNG - Lập trình .net 4.0 và visual studio 2010 part 36

ViewState là cơ chế mà theo đó các cửa hàng bang điều khiển trên một mẫu web. Thông tin này được tổ chức tại một giá trị hình thức ẩn được gọi là __VIEWSTATE. Tùy thuộc vào nội dung của trang web, ViewState có thể nhận được khá lớn, và thường không cần thiết cho điều khiển mà không thay đổi như nhãn. | CHAPTER 10 Figure 10-5. Initiating one-click publishing ViewState ViewState is the mechanism by which stores the state of controls on a web form. This information is held in a hidden form value called_VIEWSTATE. Depending on the page s content ViewState can get pretty large and is often unnecessary for controls that don t change such as labels. gives you the ability for controls to inherit ViewState settings from parent controls by using the new ViewStateMode property. This makes it very easy to efficiently set ViewStateMode on a large number of controls. ViewStateMode has three settings Enabled ViewState used Disabled ViewState not used Inherit ViewStateMode is inherited from parent control The following example shows how to make lbl1 Label inherit pnlParent s ViewStateMode. asp Panel ID pnlParent runat server ViewStateMode Disabled asp Label ID lbl1 Text text ViewStateMode Inherit runat server asp Panel 238 CHAPTER 10 ClientIDMode A long-term irritation in is the lack of control you have over the ID property of rendered controls. For example take the following HTML that is rendered from a few simple controls that are nested inside a Master page span id MainContent_label1 span div id MainContent_panel1 span id MainContent_label2 span div Most of the time s automatic ID generation features work pretty well but in some situations say when working with Master pages or writing client script you need a finer level of control. gives you this control with the new ClientIDMode. ClientIDMode has four settings AutoID Works as per previous releases. Static Allows you to specify the ID that is used. Warning you can obviously generate duplicate client IDs so it is up to you to ensure your ID is unique or face client-side script hell well probably an annoying JavaScript error anyway . Predictable Used in conjunction with RowClientIdSuffix property to generate incrementing IDs for repeating controls such as

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.