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 59 | Next

Rob Cameron and Dale Michalk

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

The variables passed in to BuildTable()
are retrieved using the Value property of the HtmlInputText controls:
int xDim = Convert.ToInt32(XTextBox.Value);
int yDim = Convert.ToInt32(YTextBox.Value);
BuildTable(xDim,yDim);
The bulk of the work in this HTML controls demonstration is located in the BuildTable()
method. This method starts by creating an HtmlTable control representing the outer
tag and then jumps into nested For loops to add HtmlTableRow controls representing the tags
along with HtmlTableCell controls rendering
tags.
One of the more interesting sections of this routine is the cell creation and CSS styling
configuration code. Once the HtmlTableCell control is created, the CSS styles are set as strings
and then added to the Style property representing the cell??™s CSS attributes. This is a manual,
string-based process that is not helped by any type or enumeration from the System.Web.UI.
HtmlControls namespace:
cell = new HtmlTableCell();
cell.Style.Add("font","16pt verdana bold italic");
cell.Style.Add("background-color","red");
cell.Style.Add("color","yellow");
CHAPTER 1 ?–  SERVER CONTROL BASICS 19
After the styling is set, the cell adds an HtmlGenericControl representing a tag to its
control collection.


Pages:
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6