Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Initializing Calendar control selectedDate upon Page_Load using C#


Message #1 by bob.szymanski@p... on Mon, 24 Jun 2002 11:59:25 -0500
This is a multipart message in MIME format.
--=_alternative 005CF56B86256BE2_
Content-Type: text/plain; charset="us-ascii"

Greetings *,

Does anyone know how I can get the calendar object in the MyCalander.aspx 
page (Sample code from Chapter 14, page 550) to initialize the 
selectedDate property to todays date?  The sample simply hard codes in a 
date.  See below:

...
      <asp:Calendar id="MyCalendar" runat="server"
        SelectedDate="10/01/2001"  <-------------------------Here
          VisibleDate="10/01/2001"
          FirstDayOfWeek="Monday"
        DayNameFormat="Full"
        ShowDayHeader="True"
        ShowGridLines="True"
        ShowNextPrevMonth="True"
        ShowTitle="True"
        nextprevstyle-backcolor="DodgerBlue"
        nextprevstyle-forecolor="White"
        nextprevstyle-font-bold="True"
        nextprevstyle-font-size="Large"
        TitleFormat="MonthYear"
        TitleStyle-BackColor="DodgerBlue"
        TitleStyle-ForeColor="White"
        TitleStyle-Font-Size="Large"
        TitleStyle-Font-Bold="True"
        dayheaderstyle-backcolor="DodgerBlue"
        dayheaderstyle-forecolor="White"
        daystyle-horizontalalign="Left"
        daystyle-verticalalign="Top"
        daystyle-font-size="Small"
        SelectedDayStyle-Font-Bold="True"
        selecteddaystyle-horizontalalign="Left"
        selecteddaystyle-verticalalign="Top"
        selecteddaystyle-font-size="Small"
        selecteddaystyle-forecolor="Red"
        TodayDayStyle-HorizontalAlign="Left"
        TodayDayStyle-VerticalAlign="Top"
        todaydaystyle-backcolor="White"

        OnDayRender="MyCalendar_DayRender"
        OnSelectionChanged="MyCalendar_SelectionChanged">
      </asp:Calendar>
...


Thanks in Advance,
Bob



  Return to Index