Main Page | Forums | Register | Active Topics | Members | Search
 
Username:
Password:
ASP Calendars Forum >> ASP Calendars >> Tips, Trick's How-To's >> Toggle between calendars
Toggle between calendars
Author Topic
champton


Newbie

Join Date: 10/9/2008
Posts: 1

Posted: 10/9/2008 7:27:22 AM

Is there code written for toggling between calendars...maybe a drop down?
ASPCalendarsAdmin


Administrator

Join Date: 12/12/2007
Posts: 51

Posted: 10/9/2008 12:01:23 PM

Here is the control code:


View style
<asp:DropDownList ID="ddlViewStyle" runat="server" AutoPostBack="True" Width="96px">
<asp:ListItem>Day</asp:ListItem>
<asp:ListItem>Week</asp:ListItem>
<asp:ListItem Selected="True">Month</asp:ListItem>
</asp:DropDownList><br />
<br />
<uc1:Calendar ID="Calendar1" runat="server" Calender="1" />


Here is the code behind code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Me.Calendar1.StartDate = Format(Date.Now, "MM/dd/yyyy")
End If
Select Case Me.ddlViewStyle.SelectedValue
Case "Day"
Me.Calendar1.ViewType = Controls_Calendar.ViewTypes.Day
Case "Week"
Me.Calendar1.ViewType = Controls_Calendar.ViewTypes.Week
Case Else
Me.Calendar1.ViewType = Controls_Calendar.ViewTypes.Month
End Select
End Sub




  Copyright ASP Calendars DMG Forums 3.1