i am so cofused for choosing between a control (asp.net) or an element (html) for having a button with background that is set with css.(background will change in hover…)
1-at first it seems asp.net ImageButton control is not good for this purpose , because my background has transparecy inside , so when we set it with css an icon appears up to the ImageButton in ie (ie default image icon).
2-serverside button control is not good for this purpose , because when we set it’s backgroung with css , so it seems there is a border around background.
3-background setting with css does not work for link button!!
4-HTML elements do n’t have server side onclick event
e.g the below code does not work :
<div runat="server" onclick="serverside">
</div>
would u plz learn me how can i do this job ?
thanks in advance
The basic answer comes from the answer to this que4stion: do you know enough to decide in the browser, or do you need to ask the server.
If you just want to change the background on hover, use CSS. There is a
hoverproperty in CSS that you can use, or you can get more complicated behavior with Javascript in the browser.If you need to, say, query the database to make the decision, first:
ask yourself why you want to do a thing like that — that will impose a significant delay between the time the conditi0ns for the change are met and the time the reply can get back.
then you’ll need some javascript to respond to the server, or else the server will have to serve the page again.