M
Marri Suliez
Does anyone know how the Style property of the WebControl class persists
between calls as if it's added to the ViewState? CssStyleCollection is
not serializable.
The following scenario leads me to believe it is being stored in
ViewState somehow:
1. Add a TextBox and a Button to a form
2. Have the Button.Click event add value to the TextBox.Style collection
3. Add a breakpoint in the Button.Click event handler immediately before
the code in step #2 is executed
4. Run the page
5. Click the button
6. When the code hits the breakpoint, note the number of TextBox.Style
items (you'll get 4, for example)
7. Allow the code in step #2 to run
8. Check the number of TextBox.Style items again (you'll get 5)
9. Click the button again
10. Repeat step 6 and you'll get 5, leading me to believe ViewState is
being used.
Any ideas? Thanks.
between calls as if it's added to the ViewState? CssStyleCollection is
not serializable.
The following scenario leads me to believe it is being stored in
ViewState somehow:
1. Add a TextBox and a Button to a form
2. Have the Button.Click event add value to the TextBox.Style collection
3. Add a breakpoint in the Button.Click event handler immediately before
the code in step #2 is executed
4. Run the page
5. Click the button
6. When the code hits the breakpoint, note the number of TextBox.Style
items (you'll get 4, for example)
7. Allow the code in step #2 to run
8. Check the number of TextBox.Style items again (you'll get 5)
9. Click the button again
10. Repeat step 6 and you'll get 5, leading me to believe ViewState is
being used.
Any ideas? Thanks.