Error using Calendar control in a Modal Dialog

Discussion in 'ASP .Net Web Controls' started by Cathie, Jul 9, 2003.

  1. Cathie

    Cathie Guest

    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
    Cathie, Jul 9, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leila
    Replies:
    0
    Views:
    403
    Leila
    Apr 26, 2005
  2. Matt
    Replies:
    1
    Views:
    3,137
    Whitecrest
    Jun 1, 2004
  3. Don
    Replies:
    0
    Views:
    348
  4. arturo_f

    Calendar Web Control in modal dialog page

    arturo_f, Aug 15, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    132
    arturo_f
    Aug 17, 2004
  5. Matt
    Replies:
    0
    Views:
    217
Loading...

Share This Page