Home > DeveloperSection > Forums > How to add an ImageButton to label
Chintoo Semi

Total Post:135

Points:947
Posted on    September-29-2014 12:32 AM

 C# C# 
Ratings:


 1 Reply(s)
 545  View(s)
Rate this:

I am tring to add an ImageButton to a label using C# but I don't success.... Can someone help me?

 

This is what I did- (Delete is the name of the label)

var img = new ImageButton();

img.ID = "delete" + i;

img.ImageUrl = "images/1395958363_meanicons_57.png";

img.OnClientClick = "Delete_Click";

img.Width = 48;

img.Height = 38;

Delete.Page.Form.Controls.Add(img);



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    September-29-2014 12:58 AM

Hi Chintoo, 

try this:

<asp:button id="myButton" style="background-image:url('2.jpg'); background-color:red; cursor:hand;" Runat="server" Height="25px" BorderStyText="ButtonText" Width="200px" />


Don't want to miss updates? Please click the below button!

Follow MindStick