October 2001
Intermediate to advanced
376 pages
7h 3m
English
Now that you can debug the basic issues with User Controls, let’s add some complexity. One of the nicest things about User Controls is that they can expose properties, making their underlying content more dynamic. They can also expose methods.
Although it’s not a requirement, it is good design practice to implement methods in User Controls only when they are needed to influence the appearance of the content of the User Control itself. Use code-behind methods of your ASP.NET page, .NET components, or Web Services if you need more utilitarian functionality.
Listings 11.3 and 11.4 show your MyControl User Control with a Name property implemented.
<%@ Control Language="C#" ... |
Read now
Unlock full access