G
Guest
I use Visual Basic .NET Framework 1.1, Visual Studio. I have a Web page
(aspx) referencing a control (ascx) that has a placeholder that is assigned
one of 2 child controls through buttons. The ViewState of the second child
control gets confused with the first child control - the first Text property
in the 2nd child gets updated with the first Text property of the 1st child
when the 2nd button is clicked after the 1st.
For instance, click 1st button (display 1st child control), first Text
property is "123456". Then click the 2nd button (display 2nd child control),
first Text property is "View Information" (a button control). Click the 1st
button again, Text property again is "123456" as it should be. Click the 2nd
button, Text property is no longer "View Information", but "123456". This
incorrect assignment occurs between the end of the <button>_Click subroutine
for the 2nd button and before the Page_Load of the 2nd child control.
I fixed the problem by changing the EnableViewState property from True to
False on the "View Information" button control.
I figure .NET is having trouble assigning the values of the two child
controls to the ViewStates when they are both within the same placeholder.
Interesting issue.
(aspx) referencing a control (ascx) that has a placeholder that is assigned
one of 2 child controls through buttons. The ViewState of the second child
control gets confused with the first child control - the first Text property
in the 2nd child gets updated with the first Text property of the 1st child
when the 2nd button is clicked after the 1st.
For instance, click 1st button (display 1st child control), first Text
property is "123456". Then click the 2nd button (display 2nd child control),
first Text property is "View Information" (a button control). Click the 1st
button again, Text property again is "123456" as it should be. Click the 2nd
button, Text property is no longer "View Information", but "123456". This
incorrect assignment occurs between the end of the <button>_Click subroutine
for the 2nd button and before the Page_Load of the 2nd child control.
I fixed the problem by changing the EnableViewState property from True to
False on the "View Information" button control.
I figure .NET is having trouble assigning the values of the two child
controls to the ViewStates when they are both within the same placeholder.
Interesting issue.