Chapter 7. Simple Properties and View State


In Chapter 3, "Component Programming Overview," we described the syntax of the property construct and discussed why you should expose properties instead of fields from your components . In this chapter, we'll get into details that are specific to properties in server controls. We'll describe how to maintain state for simple properties across round-trips. We'll also describe how declarative syntax is enabled for simple properties in an .aspx page and show you how simple properties are supported in a designer. In addition, we'll examine the basic set of properties you inherit when you derive from Control or WebControl .

It is important to clarify what we mean by simple properties and how they differ from complex properties . Simple properties are properties whose values can be easily converted into a textual (string) representation. These include primitive types such as Int32 , Boolean , and DateTime as well as other commonly used types such as String and enumerations. On the other hand, complex properties represent types that are not easily expressed as single strings. These include nonprimitive value types, reference types other than String , and collection types. We'll describe complex properties in Chapter 10, "Complex Properties and State Management."



Developing Microsoft ASP. NET Server Controls and Components
Developing Microsoft ASP.NET Server Controls and Components (Pro-Developer)
ISBN: 0735615829
EAN: 2147483647
Year: 2005
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net