"ken s" <ke**@discussions.microsoft.comwrote in message
news:06**********************************@microsof t.com...
It turns out that you get strange results if the textbox is set to
disabled.
This is a calculated field and I have it disabled so the users can't
modify
it. But eventhough I can see the value in the textbox change when I
modify
it with Javascript, I still get the old value when I try to process the
data
with c# code. It started working properly when I enabled the textbox.
Ah right - if you'd said that it was disabled, I'd have known straightaway!
This, ahem, feature of ASP.NET 2 is thankfully very easy to work round.
Don't do this:
<asp:TextBox ID="MyTextBox" runat="server" Enabled="false" />
Do this:
<asp:TextBox ID="MyTextBox" runat="server" />
And in the Page_Load of your code, do this:
MyTextBox.Attributes.Add("disabled", "true");
Same thing with readOnly...