(I think this could be two posts - 2 questions.. so if you'll comment on it... I will separate those)
the main issue is acually:
how could I set an image-background for a button... easy & properly ?
I think that now I could be sure about these facts:
as I had a "little" problem with setting image as button-background ,
...I thought, ok, if it's difficult to set <input type='button'>
with image-background, why not instead , just set onclick
event on a <input type='image'>
!
and I was right(...almost), cause yes, to set click-event on image
type is easy, also, to set src
..instead of background-image
for button... at least for me, it is.
the problem is, in current project), using a jQuery-UI dialog - ok, cancel
,
seems that the problem is that image-type , Posts back (?!), so dialog disappears
and button does not cause this flaw.
I tried to debug it with a break-point, in vs2010 and it both ok with a click event as they both get to the point of "function entry" ... so with the image type ... i could only notes, as i could see the <- Back button
, toggles from disabled
to be clickable, so it means it did post back.
and that does not happen with a button , as you hover over the button nothing happans , and with image you could see a link in status bar .
so there is a difference (a real one), between button-"convert" into image, than an image turned into a "button" (attaching it with a Click()
event) ,
so what i would like to know , is: (only if I am allowed this time to use this post for both answers as they realy relate)
why does image post back? could i disable this action? ...it is not a server control. is that something you should know, and that suppose to happen ?
again if it is off-topic i would move this question, and i do need a propper way to set the background image for a button unless there's a workaround for it's behavior.