-1

Set icon image for button in asp.net using css.to set the position of the icon and size of the icon.

2 Answers2

1

Change Your control to ImageButton or use JQuery script like @Bharat did.

Maciej S.
  • 752
  • 10
  • 22
0

You can do this like these way.

you have to add Jquery UI 1.8.5 for these.

Check fiddle here http://jsfiddle.net/nd8AJ/376/

HTML:

<div class="demo">
  <button id="dynabutton">Button with gear icon</button>
  <button id="swap">Swap icons</button>
</div>

Jquery:

$(function() {
$( "#dynabutton" ).button({
    icons: { primary: "ui-icon-gear" },
    text: false
});
$( "#swap" ).button({
    icons: { primary: "ui-icon-locked" },
    text: true
}).click(function() {
    $( "#dynabutton" ).button("option", {
      icons: { primary: "ui-icon-locked" }
    });
});         
});
Bharat
  • 5,869
  • 4
  • 38
  • 58