I want to insert an image to a LinkButton programmatically like the following aspx code:
<asp:LinkButton runat="server" ><img src="NewImages/tick.jpg" runat= "server" /></asp:Linkbutton>
I am trying the following code:
LinkButton bb = (System.Web.UI.WebControls.LinkButton)pagerTable.Rows[0].Cells[0].Controls[0];
bb.Attributes.Add("img", "NewImages/tick.jpg");
P.S PLease do not tell me to use an ImageButton :). There is a reason using this
You need to do something along the lines of
i.e. create an
Imagecontrol and add it to theLinkButton‘s child controls.