"Pro ASP.NET 3.5 Server Controls and AJAX Components"
Write("/>"); if (Control.BreakAfter) { writer.Write(" "); } } } } The device adapter inherits from HtmlControlAdapter and implements two methods. We replace the Control property using the new keyword with a strongly typed Control read-only property. ASP.NET populates this property with the associated MCTextBox control at runtime. Render is the other method we implement, and it has a few enhancements when compared to the original rendering code from the TextBox control in Chapter 5. We have logic to add a
tag if the BreakAfter property has a value of true. Similarly, we render the input tag as of type password if the Password property is set to true. We also set the size for the tag. The Size property does not enforce a rule, but it does set the initial width in characters for the control. Following the convention for the mobile control TextBox, we ignore the Numeric and Title properties??™ settings when rendering HTML. One difference from the rendering logic in Chapter 5 is that instead of using the this reference, we use the strongly typed reference stored in the Control property to get control data for rendering. Also, the writer parameter is a reference to HtmlMobileTextWriter to handle markup output.