Problem with asp:calendar....you can help me!

T

tranky

Hi, i'm an italian programmer.
I've a problem with asp:calendar control.

I'd like to click into a day of this calendar and show in a asp:label
the day.

I tried with this code_




<%@ Page Language="C#" CodeFile="Default2.aspx.cs" Inherits="Default2"
title="Antonio Tranchida - Registrazione" %>


"server"> "calendario" runat="server" Font-Size="10px"
BackColor="#ECEDF3" TitleStyle-BackColor="#D3D3D3"
TitleStyle-Font-Bold="true" Height="105px" BorderWidth="1px"
CellSpacing="0" BorderColor="#696969" Width="100%" SelectionMode="Day">
"LightGray" Font-Bold="True" CssClass="titlebg" /> "#F3F4B0"
BorderColor="black" BorderStyle="Solid" BorderWidth="1px"
ForeColor="black" /> "gray" /> "server" ID="message"> public partial
class Default2 : System.Web.UI.Page { protected void Page_Load(object
sender, EventArgs e) { message.Text =
calendario.SelectedDate.Day.ToString(); } }


This work bad.
I click into a day and nothing happens.
When i click into another day, in the label appears the previous day.

WHY??

Where's the error?

Please help me...

Thank u so much for your work.

tranky
 
D

Dave Johnson

in your .cs file
hope tht solves it

protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
Label1.Text = Calendar1.SelectedDate.Day.ToString();
}

Sharing makes All the Difference
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top