By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,971 Members | 1,451 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,971 IT Pros & Developers. It's quick & easy.

Selecting a date with the Calendar control clears the FileUpload control

P: n/a
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
nj********@hotmail.com
http://www.nathansokalski.com/
Jan 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:u5**************@TK2MSFTNGP06.phx.gbl...

<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:Calendarcontrol - use a client-side JavaScript date
picker instead.

2) Use AJAX
Jan 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.