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

Rob Cameron and Dale Michalk

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

aspx page, just before the footer:


The user can set the following properties: Font-Name, ForeColor, Bold, Italic, and Underline,
along with CssClass. In ASP.NET 1.1, the .aspx page had a link to an external style sheet called
WebControlStyle. This was useful for exercising the CssClass property, as all the style rules had
class selectors:

140 CHAPTER 4 ?–  T HE WEBCONTROL BASE CLASS AND CONTROL S TYLES
Figure 4-8. The Web Control Style web form
In ASP.NET 2.0 and later, when using master pages, a tag can be added directly to
the portion of the .aspx page, by adding a content tag to the head section of the master
page. Another option is to add the tag programmatically as shown here:
private void AddCssLinktoHeader()
{
HtmlLink cssRef = new HtmlLink();
cssRef.Href = "../Ch04/WebControlStyle.css";
cssRef.Attributes.Add("rel", "stylesheet");
cssRef.Attributes.Add("type", "text/css");
Header.Controls.Add(cssRef);
}
Notice that the Href value must be provided relative to the directory where the master
page exists.
To try applying a CSS class selector via the CssClass property, type either yellowbackground
or grayborder in the CSS class text box, and click the Set Style button.


Pages:
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6