maintain values of a textbox on Postback
-
Hi, I have a textbox which gets value from a calender control.To avoid users from manually typing I have diabled the textbox,The problem is on Postback the Textbox value i.e the date value is getting cleared. I have also tried it using Readonly Property same problem. Can any one please give me a solution , Thanks is Advance. Archana
-
Hi, I have a textbox which gets value from a calender control.To avoid users from manually typing I have diabled the textbox,The problem is on Postback the Textbox value i.e the date value is getting cleared. I have also tried it using Readonly Property same problem. Can any one please give me a solution , Thanks is Advance. Archana
I thing you have you set the autopostback property of textbox set to false cheers
-
I thing you have you set the autopostback property of textbox set to false cheers
No ,I didnt set the Autopost back,Since Im getting the value from calender control the page is automatically getting refreshed.
-
Hi, I have a textbox which gets value from a calender control.To avoid users from manually typing I have diabled the textbox,The problem is on Postback the Textbox value i.e the date value is getting cleared. I have also tried it using Readonly Property same problem. Can any one please give me a solution , Thanks is Advance. Archana
View state is maintaining value on postbacks. So try disabling viewstate for the textbox.
-
No ,I didnt set the Autopost back,Since Im getting the value from calender control the page is automatically getting refreshed.
Set the autopostback = false in aspx page check it
-
Hi, I have a textbox which gets value from a calender control.To avoid users from manually typing I have diabled the textbox,The problem is on Postback the Textbox value i.e the date value is getting cleared. I have also tried it using Readonly Property same problem. Can any one please give me a solution , Thanks is Advance. Archana
How did you disable this textbox? There is a reason why i ask this question. There are some differences between disabling textbox explicitly and disabling parent container control (eg: Panel or DIV).
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
How did you disable this textbox? There is a reason why i ask this question. There are some differences between disabling textbox explicitly and disabling parent container control (eg: Panel or DIV).
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
This link said that ~
Question 3. Why all data from web controls within the disabled panel has been lost during the postback? It’s pretty strange. In window-based application, we only need to disable the panel if we want to disable all controls inside this panel. But we can’t do like that in web development. ASP.NET doesn’t keep the viewstate of the controls if the panel is disabled so that all data in those controls within disabled panel will be lost during the PoskBack. The solution for this problem is that enable or disable each each and every controls inside the disabled panel. Enable explicitly. Scott Mitchell wrote very good article about this problem and solution in this blog.. You may check his article “Panel Weirdness” here.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
Set the autopostback = false in aspx page check it