protected void order_detail_show(object sender, EventArgs e) { edit_user.Visible = false; edit_pass.Visible = false; order_detail.Visible = true; order or = new order(); DataTable order_user = new DataTable(); order_user = or.get_user_order(dt_user.Rows[0]["id"].ToString()); int i = 0; foreach (DataRow dr in order_user.Rows) { HtmlGenericControl firstdiv = new HtmlGenericControl("div"); if (i == 0) { firstdiv.Attributes.Add("class", "accordion-group accordion-style-2 active"); } else { firstdiv.Attributes.Add("class", "accordion-group accordion-style-2"); } i++; HtmlGenericControl divheading = new HtmlGenericControl("div"); divheading.Attributes.Add("class", "accordion-heading"); HtmlGenericControl a_divheading = new HtmlGenericControl("a"); a_divheading.Attributes.Add("class", "accordion-toggle"); a_divheading.Attributes.Add("data-toggle", "collapse"); a_divheading.Attributes.Add("data-parent", "#order_detail_toggle"); a_divheading.Attributes.Add("href", "#" + dr["id"]); a_divheading.InnerHtml = " کد پیگیری : " + dr["id"] + "-" + "تاریخ سفارش : " + persian_date.Persian_date_toshamsi(dr["date"].ToString()) + "-" + "وضعیت سفارش : " + dr["status"]; HtmlGenericControl span_a_divheading = new HtmlGenericControl("span"); span_a_divheading.Attributes.Add("class", "bg-for-icon"); HtmlGenericControl imin_span_a_divheading = new HtmlGenericControl("i"); imin_span_a_divheading.Attributes.Add("class", "icon-minus"); HtmlGenericControl iplus_span_a_divheading = new HtmlGenericControl("i"); iplus_span_a_divheading.Attributes.Add("class", "icon-plus"); span_a_divheading.Controls.Add(imin_span_a_divheading); span_a_divheading.Controls.Add(iplus_span_a_divheading); a_divheading.Controls.Add(span_a_divheading); divheading.Controls.Add(a_divheading); HtmlGenericControl divcollapse = new HtmlGenericControl("div"); divcollapse.Attributes.Add("class", "accordion-body collapse"); divcollapse.Attributes.Add("id", "" + dr["id"].ToString()); HtmlGenericControl divcollapse_inner = new HtmlGenericControl("div"); divcollapse_inner.Attributes.Add("class", "accordion-inner"); //divcollapse_inner.InnerText = "salam"; order_detail_inner(divcollapse_inner, dr["id"].ToString(), dr["sendprice"].ToString(), dr["totalprice"].ToString()); divcollapse.Controls.Add(divcollapse_inner); firstdiv.Controls.Add(divheading); firstdiv.Controls.Add(divcollapse); order_detail_toggle.Controls.Add(firstdiv); } }