Accessing Controls Values Before Finishing Page_Load

Posted by userk on Stack Overflow See other posts from Stack Overflow or by userk
Published on 2010-06-16T21:27:54Z Indexed on 2010/06/16 21:32 UTC
Read the original article Hit count: 138

Filed under:
|

Hi.

I'm with a problem and want to know if someone can help me.

I'm creating a table with some controls and I want to save all control values in every postback. As the controls are just defined after the page_load, I can't solve my problem this way:

object o;
protected void Page_Load(object sender, EventArgs e)
{
 o = createObject();
    Create_Table();
 if (Page.IsPostBack)
    Save_Data();
}

I thought I could execute Save_Data() at the begining of every postback event, but I think that should exist a better way to solve my problem.

Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET