Hi,
Please check this sample code :
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
-
-
- if (!Page.IsPostBack)
- {
- string str = Server.MapPath("uploaded/img1.jpg");
- using (System.IO.FileStream streamImg = new System.IO.FileStream(str, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read))
- {
-
- Response.Write(streamImg.ToString());
-
- Attachments1.Items.Add(192, "img1Filename", streamImg);
- }
- }
- Attachments1.AttachmentAdded += new AttachmentItemEventHandler(Attachments1_AttachmentAdded);
- ButtonDeleteAll.Click += new EventHandler(ButtonDeleteAll_Click);
- ButtonTellme.Click += new EventHandler(ButtonTellme_Click);
- }
Regards,
Terry