Lets Have a fun with Technology.


Follow by Email

Monday, December 14, 2009

Calendar Extender Problem When Control Set to Read only.

Problem: - Calendar Extender Problem When Control Set to Read only.
<asp:TextBox id="txtdate" runat="server" Width="229px" Enabled="False">
<cc1:calendarextender id="Calendarextender1" runat="server" TargetControlID="txtdate" PopupButtonID="imgdate" Format="dd/MM/yyyy">

When we using ajax calendar extender control we always need to set it property to Enable= True.
If you make enable=false then ajax control extender value you not getting at server Side. Below is reason for it.
When we set any Textbox Property to read only. its value can not process on a server side because of prevent of malicious data. How ever you can access that control on server side and perform operation which you want.But at server side you can not process value from textbox because of security reason.

Still if you want to make this working then Do one trick.
Make contentEditable="false" This work for you.