예제 #1
0
        protected void btnPrint_Click(object sender, EventArgs e)
        {
            string        ImagePath = _cont.Server.MapPath("~") + @"\Attachments\BarCodes\";
            List <string> images    = new List <string>();
            int           quan      = Convert.ToInt32(qunatity.Text);

            for (int i = 0; i < quan; i++)
            {
                images.Add(String.Concat("~/Attachments/Barcodes/", Request.QueryString["val"] + ".jpeg"));
            }
            RptImages.DataSource = images;
            RptImages.DataBind();
            qunatity.Visible = false;
            btnPrint.Visible = false;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     string qry = "SELECT * FROM upload";
     SqlCommand cmd = new SqlCommand(qry, con);
     SqlDataReader dr;
     con.Open();
     dr = cmd.ExecuteReader();
     while (dr.Read())
     {
        var filep = dr.GetString(1);
        images.add(String.Concat("~/Images/", filep);
     }
     con.Close();
     RptImages.DataSource = images;
     RptImages.DataBind();
 }