HOW TO ADD AN IMAGEBUTTON TO LABEL

Chintoo Semi

Total Post:135

Points:947
Posted by  Chintoo Semi
C# 
C#
 823  View(s)
Ratings:
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);

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: How to add an ImageButton to label

    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" />

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!