SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 122 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

Cellspacing, "1");
writer.RenderBeginTag(HtmlTextWriterTag.Td);
// write
writer.RenderBeginTag(HtmlTextWriterTag.Span);
writer.Write("X:" + x.ToString());
writer.Write("Y:" + y.ToString());
// write

writer.RenderEndTag();
CHAPTER 2 ?–  ENCAPSULATING FUNCT IONALITY IN ASP.NET 67
// write
writer.RenderEndTag();
}
// write
writer.RenderEndTag();
}
// write
writer.RenderEndTag();
}
}
}
The property declarations for the X and Y dimensions of the HTML table demonstrate the
new C# 3.0 syntax available to declare simple properties in a compact manner. Instead of declaring
a private member variable and essentially empty getter and setter methods, this syntax will
create a private member variable automatically:
public int X { get; set; }
public int Y { get; set; }
More interestingly, the Render() method drives the process of rendering the control output.
Rendering the Table Header
The RenderHeader() method is responsible for displaying information about the X and Y properties
inside of an

section. The code to build the

tag demonstrates the ability to use
the special Write() methods of the HtmlTextWriter class.
WriteBeginTag() writes the starting portion of a tag, including the opening bracket and the
name of the tag, without closing it:
// write just writer.


Pages:
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6