Selecting a date with the Calendar control clears the FileUpload control

N

Nathan Sokalski

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.
 
M

Mark Rae

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
 

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,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top