I am trying to create Anchors in code behind and delete buttons as well for each Anchor. I dont know if i can call an event handler for each one of the link with an ID so i can delete the row specified from the database. This is what i have done. I created an anchor and an ASp button but not sure how i can call it with that ImageID. Is it possible? If so How? Thanks a lot in advance!! This is in C#, asp.net.
HtmlAnchor apdf = new HtmlAnchor();
apdf.ID = Guid.NewGuid().ToString("N");
string ImageID = "";
if (dsreport != null && dsreport.Tables[0].Rows.Count > 0)
{
apdf.InnerText = dsreport.Tables[0].Rows[0]["ImageName"].ToString();
apdf.Attributes.Add("style", "font-weight: bold; font-size: 13px; margin: 0px; font-family: Arial; color: #1e7c9b; text-decoration: underline");
apdf.Target = "_blank";
ImageSalesID = dsreport.Tables[0].Rows[0]["ImageID"].ToString();
apdf.HRef = "PDFdownload.aspx?ID=" + ImageID;
}
Button btnDelete = new Button();
btnDelete.ID = Guid.NewGuid().ToString("N");
btnDelete.OnClick += Eventhandler;
btnDelete.Text = "Delete";