Set a viewstate for the control that tells whether is has been posted back
on.

in your user control:

void Page_Load(...)
{
if ( ViewState["IsUCPostback"] == null )
{
ViewState["IsUCPostback"] = true;
//data binding code
}
}

HTH,

bill

"John" <a@b.com> wrote in message
news:O3i75vKQDHA.2316@TK2MSFTNGP11.phx.gbl...
> Hi all,
>
> How does a user control differentiate between the first time it has been
> loaded into a page and subsequent times?
>
> I have a situation where a user control will load, and I need to populate
a
> datagrid but not necessarily on every subsequent page postback and because
> the user control is loaded dynamically, the load event runs every time so
I
> can get viewstate. The problem is that I can't use the isPostBack method
of
> the page because that could already be true when the user control is
loaded
> into it.
>
> Regards
> John.
>
>
>