I have a datagrid with a couple of texboxes and labels. The textboxes
maintain the state properly after I update their values and postback.
However, the asp.net label and hidden fields do not maintain their
values. It always keeps the old value. Like I said the textbox works,
but I don't want to use textbox for all columns because I would have to
limit their size and I want to avoid that in certain cases, for
example, on calculated fields, and on the part number column. So, far,
I can't see any other solution for this. If you want to test that, just
add a <input type="hidden" runat="server" or a <asp:label and change
its value with javascript usinig document.all("the field").value, then
try posting back. Then, do the same using a <asp:TextBox
thanks
Rod
Rodusa wrote:
I have a hidden field inside one datagrid which I can't get to make
it keep its state after a postback event.
Look field:
<input type="hidden" id="TxtHiddenItem_id" name="TxtHiddenItem_id"
runat="server" value='<%# DataBinder.Eval(Container,
"DataItem.item_id").ToString() %>'>
I can get around that using an asp.net textbox control, but it
doesn't work well with large strings.
I don't know if it has to do with the fact that a hidden field is not
really 100% an asp.net control. The way I am changing the hidden
field value is by using javascript document.all("myfield").value;
Rod