Hi everyone
this is my page load code then when i wantto edit my data
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!this.IsPostBack)
- { DataTable dtAttach = Donate.GetMatDonationAttach(SID);
- {
- if (dtAttach.Rows.Count > 0)
- {
-
- for (int i = 0; i <= dtAttach.Rows.Count - 1; i++)
- {
- Control tempControl = this.Page.LoadControl("UC/UC.ascx");
- ((ASP.sysadmin_credit_donationmaterial_uc_uc_ascx)tempControl).EquipmentName = dtAttach.Rows[i]["ObjName"].ToString();
- ((ASP.sysadmin_credit_donationmaterial_uc_uc_ascx)tempControl).Quantity = dtAttach.Rows[i]["Quantity"].ToString();
- ((ASP.sysadmin_credit_donationmaterial_uc_uc_ascx)tempControl).UnitPrice = dtAttach.Rows[i]["UnitPrice"].ToString();
- attachSID = Convert.ToInt32(dtAttach.Rows[i]["SID1"].ToString());
- pHolder.Controls.Add(tempControl);
- }
- }
- }
- }
- }
then add another usercontrol on my page, but loaded data automatically remove on the my page
this is my adding user control button
- protected void btnAdd_Click(object sender, EventArgs e)
- {
- for (int i = count; i <= _block.Count; i++)
- {
- if (!this._block[i].Visible)
- {
- this._block[i].Visible = true;
- break;
- }
- }
- }
how can i resolve when i add new usercontrol then keep old usercontrol and data ??