0

I'm confused as to when each comes into play and what their exact function is. I'm reading an article that claims that a TextBox's internal Text property would have this getter/setter method.

public string Text
{
    get { return (string)ViewState["Text"]; }
    set { ViewState["Text"] = value; }
}

The article goes on to say that "A very common conceptual error is the thought that Viewstate is responsible for preserving posted data. This is absolutely false; Viewstate has nothing to do with it."

Well, lets say I have a bunch of checkboxes which are added to the aspx page dynamically in C#. When a button is clicked in the browser, I want the state of the checkboxes in the browser to be saved (I want to remember the 'checked/unchecked' state across postbacks). Does ViewState do this or does Loadpostbackdata do this?

thanks.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by __avd
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.