Now, the text boxes lose their value when the user clicks the run
report button. I have verified this is happening because it’s doing a
postback, but the values are gone before page_load is called. I have
EnableViewState set to true for both text boxes and it’s not retaining
the values. I have tried variations of ways to fix this (set the
values in a view state object, enable view state on the page as a
whole, etc) and nothing is working.
Am I missing something?
"Doogie" <dnlw...@dtgnet.com> wrote in message
news:036bd68e-8158-45ee...@27g2000hsf.googlegroups.com...
Turns out that the fact the text boxes are disabled is what is causing
the issue. Setting them to be enabled fixed the issue. Weird, not
sure why I wouldn't be able to do that. I have them disabled cause I
wanted them to only be filled by the calendar popup and not manually
entered.
> Turns out that the fact the text boxes are disabled is what is causing
> the issue. Setting them to be enabled fixed the issue. Weird, not
> sure why I wouldn't be able to do that. I have them disabled cause I
> wanted them to only be filled by the calendar popup and not manually
> entered.
Aha! I've seen that before.
Had you disabled the textboxes in the actual markup i.e. in the <asp:TextBox
> tag?
If so, try disabling them in codebehind e.g.
TextBox1.Enabled = false;
or even
TextBox1.Attributes.Add("disabled", "disabled");
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
You could set submitdisabledcontrols="true" on the <form> element of the
page which makes asp.net to post also disabled textboxes values. I believe
disabled HTML form elements don't submit by default.
Other option is to set TextBox as readonly but that has to be done via
Attributes.Add
(http://aspadvice.com/blogs/joteke/archive/2006/04/12/16409.aspx) as setting
ReadOnly property prevents postback data from being loaded, meaning in
practise that TextBox doesn't keep its state (it's read-only from
server-side perspective)
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Doogie" <dnlw...@dtgnet.com> wrote in message
news:c59f6994-27bd-48db...@34g2000hsf.googlegroups.com...