Problem With CalendarExtender Control

Last post 05-13-2008 1:16 PM by raddrick. 3 replies.

Sort Posts:

  • Problem With CalendarExtender Control

    11-30-2007, 2:17 PM
    • Member
      point Member
    • arunmenon
    • Member since 11-30-2007, 7:09 PM
    • Posts 1

    Hi,

    I am facing a problem with CalendarExtender Control. In my web page, I have placed a CalendarExtender Control and associated it with a TextBox. I have kept a Button Control in my page which when click performs a postback. After I click on the TextBox and select the required date, the date appears on the TextBox control. If I click on the Button Control which performs a postback, it works fine.

    But, if I set the ReadOnly property to True for the TextBox, on postback, the date that has been selected gets cleared from the TextBox and the CalendarExtender.SelectedDate results to a null value. I want to set the ReadOnly Property of the TextBox to True so that the users of the page doesn't type anything of their own will. I saw that even if the users type anything they want, it pops up with an alert saying that the selected date is of an  unrecognized format. But, I'd like to set the Calendar Associated Textbox as ReadOnly.

     Please Help Me. It's Urgent. Thanks in Advance.

    AKM

  • Re: Problem With CalendarExtender Control

    12-02-2007, 7:17 PM
    • Contributor
      5,590 point Contributor
    • deblendewim
    • Member since 12-20-2006, 4:32 PM
    • Antwerp, Belgium
    • Posts 951

    Hi arunmenon,

    This thread will provide answers to your questions (I hope Wink) http://forums.asp.net/t/1152829.aspx

     

    Kind regards,
    Wim

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Problem With CalendarExtender Control

    12-06-2007, 3:47 AM
    Answer

    Hi,

    Thank you for your post!

    I am sorry to tell you that a control that is ReadOnly or Disabled won't post its value being changed to the server. 

    The workaround is to add a hiddenField, also assign the value of the disabled textbox to the HiddenField via javascript when the postback is starting. Then get the hiddenField's value on server side. 

    If you have further questions,let me know.

    Best Regards,

    Sincerely,
    Jin-Yu Yin
    Microsoft Online Community Support
  • Re: Problem With CalendarExtender Control

    05-13-2008, 1:16 PM
    • Member
      10 point Member
    • raddrick
    • Member since 11-13-2007, 12:35 PM
    • Posts 13
    try this:

    tb.Text = Request[tb.UniqueID];

    works for me in some cases, but not always
    Rick Graham
    System Developer
Page 1 of 1 (4 items)
Microsoft Communities