How to debug to find where a value is changing in C#/ASP.Net -
a project inherited uses dynamiccontrolsplaceholder
. within placeholder, code adds controls render out to
<table> <-- htmltable <tr> <-- htmltablerow <td> <-- htmltablecell question <-- literalcontrol </td> ... </tr> ... </table>
the dynamiccontrolsplaceholder
correctly stores structure in viewstate
, correctly restores structure (though <td>
has literalcontrol
empty text property rather "question").
some time later, in
system.web.ui.page.loadallstate() system.web.ui.control.loadviewstaterecursive(object savedstate) system.web.ui.control.loadchildviewstatebyindex(system.collections.arraylist childstate) system.web.ui.control.loadviewstaterecursive(object savedstate) system.web.ui.control.loadchildviewstatebyindex(system.collections.arraylist childstate) ... (lots of recursive calls) ... system.web.ui.htmlcontrols.htmlcontainercontrol.loadviewstate(object savedstate) system.web.ui.htmlcontrols.htmltablerow.htmltablecellcontrolcollection.add(system.web.ui.control child)
an exception thrown stating htmltablerow
cannot contain literalcontrol
child, htmltablerows
may contain htmltablecells
. stored reference htmltablerow
using immediate window in vs's debugger during recreation of structure.
as said before, during creation, structure correct, aside literalcontrol
not having value. time exception thrown, htmltablerow
has lost child controls , gained attribute
called innerhtml = "question"
. guess (whatever it is--the viewstate
?) seeing attribute , converting literalcontrol
, , failing since it's lost htmltablecell
.
i don't know how debug further here. thought maybe there way set variable (x
) in immediate window, , set data breakpoint when x.cells[0]
changes or something, looks data breakpoints unmanaged code.
any ideas on how unblock debugging? thanks.
Comments
Post a Comment