two different user controls in same asp.net page

1.2k Views Asked by At

this is my application link please download

i had 2 different user controls in one .aspx page.

first user control was dropdownlist binded with database. second user control was gridview.

if i select a company int the dropdownlist products of that company should be displayed in the second user control.

my problem was, when i am selecting the companies in the dropdownlist gridview user control is loading first and 2nd dropdownlist selected event is firing..

please help me...

1

There are 1 best solutions below

1
On

You should probably check the IsPostBack property and only populate the controls if it isn't a postback.

void Page_Load()
{
  if (!IsPostBack)
  {
    // Populate the user controls.
  }
}

But since you didn't show any code I'm just guessing.