JavaScript Editor jscript editor     Web designer 



Main Page

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

To set style properties in the .aspx file

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

    Visual BasicВ CopyCode imageCopy Code
    <asp:Calendar Id="MyCalendar" 
      SelectionMode="DayWeek" runat="server" 
      TitleStyle-Backcolor="#3366ff"
      TitleStyle-ForeColor="White" />
    
    C#В CopyCode imageCopy Code
    <asp:Calendar Id="MyCalendar" 
      SelectionMode="DayWeek" runat="server" 
      TitleStyle-Backcolor="#3366ff"
      TitleStyle-ForeColor="White" />
    

    -or-

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

    Visual BasicВ CopyCode imageCopy Code
    <asp:Calendar id="Calendar1" 
      SelectionMode="DayWeek" runat="server">
      <TitleStyle BackColor="#3366ff" ForeColor="white" />
    </asp:Calendar>
    
    C#В CopyCode imageCopy Code
    <asp:Calendar id="Calendar1" 
      SelectionMode="DayWeek" runat="server">
      <TitleStyle BackColor="#3366ff" ForeColor="white" />
    </asp:Calendar>
    

See Also



JavaScript Editor jscript editor     Web designer