tailieunhanh - Pro Server Controls and AJAX Components phần 2

: Lớp này được thừa hưởng từ DataBoundControl và có thể phục vụ như là lớp cơ sở dữ liệu dạng bảng có ràng buộc điều khiển bao gồm các điều khiển máy chủ khác. trong trường hợp một nhà phát triển kiểm soát có thể luôn luôn chỉ cần kế thừa từ Control | 52 CHAPTER 2 ENCAPSULATING FUNCTIONALITY IN Next add the assembly to a test web application by right-clicking the application selecting Add Reference and browsing to the user control assembly. The next step is to make the server control available on a web form by registering it @ Register TagPrefix apressiic Namespace ControlsBook2 Assembly The final step is to add a tag to the .aspx page apressUC SimpleUserControl ID SimpleUserControl1 runat server While it is possible to deploy a user control in a similar manner to a custom server control as shown in the preceding example deployment of a user control as an .ascx file is a bit more straightforward and probably more applicable where user controls are of most interest which is for sharing code internal to an organization. The design-time rendering of user controls and the ability to deploy a user control as an assembly are welcome improvements custom server controls provide superior designtime capabilities simpler deployment and finer control over functionality. Naturally all the benefits of custom controls do not come for free. Generally custom controls require a longer development cycle and a higher skill level from the development staff. The focus of this book is on custom server control development with the goal of easing the learning curve and developing some useful server control samples to help you get started. Building a User Control So far we ve discussed user controls and custom server controls and their benefits and differences. User controls and server controls have differing strengths and trade-offs that we highlight in this section by building two families of controls A static hyperlink menu control A dynamically generated HTML table control The example controls we present may seem simple and somewhat removed from real-world web projects but we do this for a reason. We believe that you must start simple and build toward more complexity to .

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.