Welcome Guest Search | Active Topics | Sign In | Register

What am I doing wrong? Calendar & Textbox Options
RyanD
Posted: Wednesday, September 1, 2010 5:52:40 PM
Rank: Newbie
Groups: Member

Joined: 9/1/2010
Posts: 6
I'll quickly say I'm new some what new to .Net, so any reading on the subject I'm happy to do.

All I'm trying to do is a simple control using the calendar and a text box. When a date is selected from the calendar, populate the text box. For some reason, I'm not getting anything back at all.

Code: C#
public partial class ShippingDateSelection : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }


        protected void select_CalendarDate(object sender, EventArgs e)
        {
            DateTime selectedShipDate = Calendar1.SelectedDate;
            txtSelectedDate.Text = selectedShipDate.ToLongDateString();
        }

    }


Code: HTML/ASPX
<eo:Calendar runat="server" id="Calendar1" DayCellWidth="21" DayHeaderFormat="FirstLetter"
		DayCellHeight="16" GridLineFrameVisible="False" TitleLeftArrowHtml="&amp;lt;" TitleFormat="MMM yyyy"
		TitleRightArrowHtml="&amp;gt;" GridLineColor="207, 217, 227" GridLineVisible="True"
        OnSelectionChanged="select_CalendarDate">
		<DayStyle CssText="border-right: #eaeaea 1px solid; border-top: #eaeaea 1px solid; border-left: #eaeaea 1px solid; border-bottom: #eaeaea 1px solid; background-color: #eaeaea"></DayStyle>
		<SelectedDayStyle CssText="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid; background-color: white"></SelectedDayStyle>
		<TitleStyle CssText="padding-right: 3px; padding-left: 3px; font-weight: bold; padding-bottom: 3px; color: white; padding-top: 3px; border-bottom: #cfd9e3 1px solid; background-color: #006699; font-size: 11px; font-family: verdana;"></TitleStyle>
		<CalendarStyle CssText="border-right: #cfd9e3 1px solid; border-top: #cfd9e3 1px solid; font-size: 11px; border-left: #cfd9e3 1px solid; cursor: hand; border-bottom: #cfd9e3 1px solid; font-family: verdana; background-color: #eaeaea"></CalendarStyle>
		<DayHoverStyle CssText="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid; background-color: white"></DayHoverStyle>
		<MonthStyle CssText="font-size: 11px; font-family: verdana;"></MonthStyle>
		<DayHeaderStyle CssText="height: 17px"></DayHeaderStyle>
	</eo:Calendar>
                      
    <asp:TextBox ID="txtSelectedDate" runat="server" />
eo_support
Posted: Wednesday, September 1, 2010 6:10:34 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to set the Calendar's AutoPostBackOnSelect to true.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.