Lets Have a fun with Technology.

BTemplates.com

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">
asp:TextBox>
<cc1:calendarextender id="Calendarextender1" runat="server" TargetControlID="txtdate" PopupButtonID="imgdate" Format="dd/MM/yyyy">
cc1:calendarextender>

Solution:-
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.


1 comment:

  1. I have been struggling against this problem and your post helped me a great deal. Thank you for the tip! :D

    ReplyDelete