How do I keep a control from initializing every time? - 09-24-2004 , 11:27 AM
I have a header control at the top of my default page. On this control
there are 4 buttons, each one displays a corresponding panel.
There also is a drop down list with a list of counties. The list of
counties is filled from a dataset when the page loads. The user selects a
county, and then selects a button. Each time a button is selected, the
control reloads and the county selection is lost and is filled again, not
only taking a lot of time but losing the user's selection. How do I stop
the drop down list from loading each time? I have tried using If
ispostback, then FillCountyList, but it doesn't seem to matter. Thanks.
Re: How do I keep a control from initializing every time? - 09-24-2004 , 01:45 PM
"Carter" <eagletender2001 (AT) yahoo (DOT) com> wrote
like a form with one dropdown and one button, which doesn't do anything.
Second, it sounds like you are refilling the DropDownList on every postback.
Your Page_Load should probably look something like this:
private void Page_Load(object sender, EventArgs e)
// Load your datasets
DataBind(); // Binds loaded data to all controls
// You shouldn't need to load anything since data were saved in
|Thread Tools||Search this Thread|