T
Tumurbaatar S.
My web user control (ASCX) consists of one DataGrid and several
web user controls (ASCX). On page postback, the DataGrid loses
its content: row/item information, i.e. cells text. Other user controls
(and standard controls too) do not lose theirs text.
I checked ViewState value of the page with the ViewStateDecoder (
v1.1, by Fritz Onion) and found that something wrong with ViewState.
The decoder raises an error:
There was an error decoding the ViewState string: Key cannot be null.
Parameter name: key
Any ideas?
P.S. I've not tested it, but may be, this happens because I use controls in
items.
For example, on ItemDataBound event:
I do so
e.Item.Cells.Controls.Add(new LiteralControl("some text"))
instead of
e.Item.Cells.Text = "some text";
I use LiteralControl instead of cells Text because I need to insert
break tags (<br>) within cells. Is there a way to do this without
LiteralControl?
web user controls (ASCX). On page postback, the DataGrid loses
its content: row/item information, i.e. cells text. Other user controls
(and standard controls too) do not lose theirs text.
I checked ViewState value of the page with the ViewStateDecoder (
v1.1, by Fritz Onion) and found that something wrong with ViewState.
The decoder raises an error:
There was an error decoding the ViewState string: Key cannot be null.
Parameter name: key
Any ideas?
P.S. I've not tested it, but may be, this happens because I use controls in
items.
For example, on ItemDataBound event:
I do so
e.Item.Cells.Controls.Add(new LiteralControl("some text"))
instead of
e.Item.Cells.Text = "some text";
I use LiteralControl instead of cells Text because I need to insert
break tags (<br>) within cells. Is there a way to do this without
LiteralControl?