-1

i have one web form dashboard that shows up drop down combos and one grid view. all goes fine for some previous days. but now i can't understand why controls binds up two time. I avoid them for second time binding with !Page.IsPostBack and it's works fine for some previous day. and now it's not works fine. how ever it's just binds up two time but when every time page refresh the result is same with two time binding data appears. why this happens... i just give you idea when page reload first and after that renders all controls after loading.

1) When First Page Called it's have first time binds

![enter image description here

2) When Page Renders all controls with data enter image description here

i have no idea why this happen is that problem with my code or calling java scripts. this is my page load code for preventing multi time binding data to controls:

DAL_General obj = new DAL_General();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Fill_Combo();
            Get_Data();
        }
    }
    protected void Fill_Combo()
    {
        DAL_ComboFill obj_u = new DAL_ComboFill();
        obj_u.Fill_Users_Combo(this, ddl_users, false, true);
        obj_u.Fill_SenderIds_Combo(this, ddl_sender, false, true);
        obj_u.Fill_Status_Combo(this, ddl_delevery, false, true);
        obj_u.Fill_AccountType_Combo(this, ddl_account, false, true);   
    }

please help me out guys....

shalin gajjar
  • 646
  • 4
  • 15
  • 44

1 Answers1

0

Please clear all combo first clear after add bind data like this.

ddl.Items.Clear();

OR

if(ddl_users.items.Count == 0)
{
  Fill_Combo();
}

And also set grid data assign first null after bind another data.

Hemang A
  • 1,012
  • 1
  • 5
  • 16