Selecting a date with the Calendar control clears the FileUpload control

Discussion in 'ASP .Net' started by Nathan Sokalski, Jan 11, 2007.

  1. I have an ASP.NET 2.0 webform which includes both a FileUpload contol and a
    Calendar control. When the user selects a new data with the Calendar
    control, the FileUpload control is reset (there is no longer a file selected
    if one was previously selected). I am assuming this is because the Calendar
    control causes a postback when a date is selected. Does anyone know of a way
    to prevent this from happening? Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/
     
    Nathan Sokalski, Jan 11, 2007
    #1
    1. Advertising

  2. Nathan Sokalski

    Mark Rae Guest

    "Nathan Sokalski" <> wrote in message
    news:...

    <cross-posting removed>

    > I have an ASP.NET 2.0 webform which includes both a FileUpload contol and
    > a Calendar control. When the user selects a new data with the Calendar
    > control, the FileUpload control is reset (there is no longer a file
    > selected if one was previously selected). I am assuming this is because
    > the Calendar control causes a postback when a date is selected.


    Yes - that and the fact that the FileUpload control doesn't persist its
    value in ViewState, nor can it be populated manually, for security
    reasons...

    > Does anyone know of a way to prevent this from happening?


    1) Don't use the <asp:Calendar> control - use a client-side JavaScript date
    picker instead.

    2) Use AJAX
     
    Mark Rae, Jan 11, 2007
    #2
    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. Shevek
    Replies:
    3
    Views:
    6,070
    Shevek
    Jun 23, 2004
  2. TD is PSP

    FileUpload clears on Insert

    TD is PSP, Apr 20, 2008, in forum: ASP .Net
    Replies:
    6
    Views:
    4,107
    lvcapsfan
    Dec 28, 2009
  3. Mufasa
    Replies:
    0
    Views:
    406
    Mufasa
    Sep 5, 2008
  4. Bob Hansen

    Calendar Control - Selecting a date in another month

    Bob Hansen, Oct 5, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    148
    Robert Koritnik
    Oct 5, 2004
  5. Nathan Sokalski
    Replies:
    0
    Views:
    267
    Nathan Sokalski
    Jan 11, 2007
Loading...

Share This Page