Partilhar via


Como: conjunto propriedades de estilo de controle de servidor ASP.NET usando sintaxe do ASP.NET

You can set style properties directly in the .aspx file in two ways.

To set style properties in the .aspx file

  • Declare the style property using a convention of hyphenating the style object name and property, as shown in the following example:

    <asp:Calendar Id="MyCalendar" 
      SelectionMode="DayWeek"  
      TitleStyle-Backcolor="#3366ff"
      TitleStyle-ForeColor="White" />
    
    <asp:Calendar Id="MyCalendar" 
      SelectionMode="DayWeek"  
      TitleStyle-Backcolor="#3366ff"
      TitleStyle-ForeColor="White" />
    

    - ou -

  • Declare explicit elements in which you declare property elements of the appropriate data type, as shown in the following example:

    <asp:Calendar id="Calendar1" 
      SelectionMode="DayWeek" >
      <TitleStyle BackColor="#3366ff" ForeColor="white" />
    </asp:Calendar>
    
    <asp:Calendar id="Calendar1" 
      SelectionMode="DayWeek" >
      <TitleStyle BackColor="#3366ff" ForeColor="white" />
    </asp:Calendar>
    

Consulte também

Tarefas

Como: conjunto propriedades de estilo de controle de servidor ASP.NET por programação

Conceitos

Controle de Servidor Web do ASP.NET e Estilos CSS

Outros recursos

Aprendendo mais — Programando páginas da Web do ASP.NET