Error using Calendar control in a Modal Dialog

C

Cathie

I am trying to use a calendar control in a modal dialog box but when I set
SmartNavigation to true (necessary for the modal dialog to referesh itself
when a button is fired) I get the following error:

javascript__doPostBack('Calendar1','1287')
Object Expected

Is there any way to get this to work?
Note: I am currently using Framework 1.0

aspx code:
<asp:Calendar id="Calendar1" runat="server"
Visible="False"></asp:Calendar>
(obviously &lt; = < and &gt; = >)

aspx.cs code:
protected System.Web.UI.WebControls.Calendar Calendar1;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;

private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
Calendar1.SelectedDate = Calendar1.TodaysDate;
}
}

private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Calendar1.SelectionChanged += new
System.EventHandler(this.Calendar1_SelectionChanged);
this.Load += new System.EventHandler(this.Page_Load);
}


private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
{
TextBox1.Text = Calendar1.SelectedDate.ToString("dd/mm/yyyy");
Calendar1.Visible = false;
}

private void Button1_Click(object sender, System.EventArgs e)
{
Calendar1.Visible = true;
}


Cathie
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top