Ask a Question related to ASP.NET General, Design and Development.
-
William F. Robertson, Jr. #1
Re: Repost : Usercontrol loading and once-off processing
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...a> 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 populateI> datagrid but not necessarily on every subsequent page postback and because
> the user control is loaded dynamically, the load event runs every time soof> can get viewstate. The problem is that I can't use the isPostBack methodloaded> the page because that could already be true when the user control is> into it.
>
> Regards
> John.
>
>
>
William F. Robertson, Jr. Guest
-
Error Loading UserControl
I am revieving the following error for one of my controls when loading any pages that use it: Server Error in '/exposure/app' Application.... -
CGI: Help with "loading" message while processing.
Using Perl 5.6.0. I need to temporarily show a message while I process in the background. The process calls an OLE component which sets a value in... -
Loading UserControl in ASP.NET...
Is it possible to create a UserControl or Windows Form within a WebForm? What I wanted to do is to create a stand-alone .NET Windows Form... -
Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack
a uscontrol test.ascx have a dropdownlist web control the dropdownlist's AutoPostBack property is set "true" but when i use... -
Usercontrol loading question
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...



Reply With Quote

