private void LoadControls(string user_code) { int user_id = int.Parse(user_code); data_table = data_file.GetUserDetails(user_id); if (data_table.Rows.Count > 0) { lblCode.Text = data_table.Rows[0]["UserId"].ToString(); txtlname.Text = data_table.Rows[0]["FirstName"].ToString(); txtfname.Text = data_table.Rows[0]["LastName"].ToString(); txtphone.Text = data_table.Rows[0]["Phone"].ToString(); txtemail.Text = data_table.Rows[0]["Email"].ToString(); string area_code = data_table.Rows[0]["AreaID"].ToString(); string type_code = data_table.Rows[0]["UserType"].ToString(); bool isactive = bool.Parse(data_table.Rows[0]["Active"].ToString()); ddlAreas.SelectedIndex = ddlAreas.Items.IndexOf(ddlAreas.Items.FindByValue(area_code)); ddlUserType.SelectedIndex = ddlUserType.Items.IndexOf(ddlUserType.Items.FindByValue(type_code)); chkActive.Checked = isactive; MultiView2.ActiveViewIndex = 1; } }