UpdatePanel
ASP.Net HTML5 controls with postback + dynamic design-time properties
Brought to you by:
ja928
Hi all.
I was asked to create a mobile version of an existing site built in .NET 2.0.
The control (Date input) had been working fine until I included an UpdatePanel in the page.
I am testing it using Firefox, Safari on a desktop (in iPhone mode), Safari on the actual iPhone and Chrome on the iPhone as well, and an iPhone Emulator for Windows.
The weird thing is when submitting the form using Firefox and the iPhone Emulator the value entered is posted back. The other tests, the control value (date) is null.
Any ideas what is going on here?
Thank you in advance!
Carlos
Anonymous
The ASP.NET code for update panels in .NET 2.0 only works with browsers that does not recognize the new HTML5 input type - it will only do partial postback of known old fashioned input types.
I think there was an update for .NET 4.0 that might fix this - so try upgrading your project and see if it then works.
Otherwise you have to use and old style input field and code the date selection yourself, or add javascript to copy the input from the new HTML5 fields to a hidden field before the ASP.NET update panel javascript logic fires.
(You might also find that the implementation of date input varies too much between browsers to be of any use yet, so consider adding your own date selection UI optimized for the kind of date input that you would like.)