c# - Ajax calenderextender SelectedDate value is always null. -


i have run problem have textbox calenderextender ajaxtoolkit. retrieve value user puts in. how code looks like

<asp:textbox id="txtvalidfrom" runat="server" textmode="datetime" autopostback="true" ></asp:textbox> <asp:textbox id="txtvalidto" runat="server"></asp:textbox> <ajaxtoolkit:calendarextender id="exvalidfrom" runat="server" targetcontrolid="txtvalidfrom" firstdayofweek="monday" format="dd/mm/yyyy"></ajaxtoolkit:calendarextender> <ajaxtoolkit:calendarextender id="exvalidto" runat="server" targetcontrolid="txtvalidto" firstdayofweek="monday" format="dd/mm/yyyy"> </ajaxtoolkit:calendarextender> 

and code behind:

logg.validfrom = exvalidfrom.selecteddate; logg.validto = exvalidto.selecteddate; 

where validfrom , validto datetime? variables. no matter user presses null value. have tried take text direct textbox using

logg.validfrom = system.convert.todatetime(txtvalidfrom.text); logg.validto = system.convert.todatetime(txtvalidto.text); 

but error

string not recognized valid datetime.

any ideas how solve this?


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -