DNN Module.
-
Hi All I am sorry if I am asking this question on a wrong forum. I am working with the DNN PopUp Calendar control, I have a textbox next to it that displays whatever date I choose from the Calendar. I want that textbox to be readonly, but the problem is that if I set the ReadOnly property of the textbox to true, the textbox always defaults back to the default values (today's date) after the postback. But if the ReadOnly property is false it displays the date I chose on the textbox even after the postaback. So I would like to know how to make the textbox readonly but still keep the selected date displayed on the textbox after postback. I initialse the textbox to today's after inside the if(!IsPostback) block. Thank you in advanced for your assistance. Kind Regards MP
MP
-
Hi All I am sorry if I am asking this question on a wrong forum. I am working with the DNN PopUp Calendar control, I have a textbox next to it that displays whatever date I choose from the Calendar. I want that textbox to be readonly, but the problem is that if I set the ReadOnly property of the textbox to true, the textbox always defaults back to the default values (today's date) after the postback. But if the ReadOnly property is false it displays the date I chose on the textbox even after the postaback. So I would like to know how to make the textbox readonly but still keep the selected date displayed on the textbox after postback. I initialse the textbox to today's after inside the if(!IsPostback) block. Thank you in advanced for your assistance. Kind Regards MP
MP
khuzwayom wrote:
I want that textbox to be readonly, but the problem is that if I set the ReadOnly property of the textbox to true, the textbox always defaults back to the default values (today's date) after the postback. But if the ReadOnly property is false it displays the date I chose on the textbox even after the postaback.
This is not a issue with Dot Net Nuke. If you are doing the same in ASP.NET you will face the same problem. If you make any text box as Read Only it will not send the updated value on post back.
Quick Fix :
UseContentEditable="False"
instead of Readonly. It will do the trick for you. ;)Solution Approach :
1 .Before Post back read the value in hidden field and after postback place the hidden field value to the textbox ;) 2. You can create your own custom textbox control also. Check here. There was a discussion on same topic 1 year back in CP http://www.codeproject.com/script/Forums/View.aspx?fid=12076&msg=2395528[^] Hope it will helpcheers, Abhijit CodeProject MVP