As you know, ASP.NET pages contain a mixture of ordinary HTML tags and ASP.NET controls. To add
HTML tags, you simply type them in or drag them from the HTML tab of the Toolbox.
Visual Studio provides a valuable style builder for formatting any static HTML element with CSS
style properties. To test it, add the <div> element from the HTML section of the Toolbox. The <div> will
appear on your page as a borderless panel. Then click to select the panel, and click the Style box in the
Properties window. An ellipsis (…) button will appear in the Style box. When you click it, the Modify
Style dialog box (shown in Figure 2-5) will appear, with options for configuring the colors, font, layout,
and border for the element.
When you create a new style in this way, it will be stored as an inline style, and recorded in the style
attribute of the element you’re modifying. Alternatively, you can define a named style in the current
page (the default) or in a separate stylesheet. You’ll learn more about these techniques and Visual
Studio’s support for stylesheets in Chapter 16.
If you want to configure the HTML element as a server control so that you can handle events and
interact with it in code, you need to switch to source view and add the required runat="server" attribute
to the control tag.
Hiç yorum yok:
Yorum Gönder