Hi,
I would like to add a text and image to my link button. I want to show text on left and image on the right side of the button.
Here is the code that i wrote:
LinkButton mybutton = new LinkButton();
mybutton.Text = "Hindhi";
mybutton.Controls.Add(new ImageButton()
{
ImageUrl = @"c:\APPthemes\img\india.gif"
});
Many thanks,
Darma
Loading
Javeed M ShaikhPosted Apr 24, 2013, 12:14 PM
LinkButton mybutton = new LinkButton();
mybutton.Controls.Add(new ImageButton()
{
ImageUrl = @"c:\APPthemes\img\india.gif"
});
Label mylabel = new Label();
mylabel.Text = "Sample text";
p1.Controls.Add(mybutton);
p1.Controls.Add(mylabel);
I have added the below line in my aspx:
Javeed M ShaikhPosted Apr 24, 2013, 4:53 PM
darma tejaPosted Apr 24, 2013, 4:04 PM
One more thing I want to say if I use hard code path for my image, the image is not showing in the browser.
When I use "~\img\india.gif", It is showing in the browser.
Darma