TAILIEUCHUNG - ASP.NET 4 Unleased - p 76

Trong Page_Load () xử lý sự kiện, một cá thể của các thành phần HelloWorld được tạo ra. phương pháp tiếp theo, kết quả trả về bởi một cuộc gọi đến các SayMessage () được giao cho một điều khiển Label. Khi bạn mở trang trong trình duyệt của bạn, bạn xem thông điệp Hello World!. | 724 CHAPTER 17 Building Components div form body html In the Page_Load event handler an instance of the HelloWorld component is created. Next the result returned by a call to the SayMessage method is assigned to a Label control. When you open the page in your browser you see the message Hello World . This process of creating the component is simple. You don t need to perform any special registration and you don t need to compile anything explicitly. Everything just works magically. Components and Dynamic Compilation You are not required to explicitly compile build the component because Framework automatically compiles the component for you. Any component that you add to the App_Code folder is compiled dynamically in the same way as an page. If you add a new component to the App_Code folder and request any page from your website the contents of the App_Code folder are compiled into a new assembly and saved to the Temporary Files folder located at the following path C WINDOWS Framework version Temporary Files application name Whenever you modify the component the existing assembly in the Temporary Files folder is deleted. The App_Code folder is compiled again when you make a new page request. NOTE An assembly is the dll file or dll files in which components are stored. You can add as many subfolders to the App_Code folder as you need to organize your components. The Framework finds your component no matter how deeply you nest the component in a subfolder. One significant drawback of this process of dynamic compilation is that any errors in any component contained in the App_Code folder prevent any pages from executing. Even if a page does not use a particular component any syntax errors in the component raise an exception when you request the page. From the Library of Wow eBook Building Basic Components 725 TIP If a component contains an error and you want to temporarily hide the component from ASPNET .

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.