How do I emulate a LinkButton with this HTML clickable image?



How do I emulate a LinkButton with this HTML clickable image?

I have been using a LinkButton with an OnCommand event (it has a
background image repeated). I want to replace the LinkButton with bit
of html which looks like an image button but has the text as html -
this uses two images (a matching left and right image) so that it has
pretty rounded corners. PS: this is the kind of thing which is
typically done when making css tabbed menus.

My html looks like this:

<div class="Button" id="btnReset"><a class="aButton"
href="javascript:Clear();" title="Refresh"><span

The button displays fine and the two images look like a seamless
whole. The point of this being that I can use any word apart from
"Refresh" and the images will size themselves in the background to
wrap the text nicely. The <a> element has the LHS part of the button
and the sButton class references the RHS of the button.

How do I fire a server side event from that "javascript:Clear();"?

There is a matching button to this as well with a

I have thought of storing a suitable value in a hidden form variable.
Can I then submit the form from javascript?, and then select
the server-side to execute depending on the value of the form variable
(seems a pretty ugly way of doing things to me). What is the 'correct'
way of doing this?

I have no intention of making a user control as it would be more
productive to ajaxify the page but, right now, I prefer something

Nick Chan

<input type="hidden" value="0" name="Clicked"/>

<div class="Button" id="btnReset"><a class="aButton"

sub PageLoad

if Request.Form("Clicked") = "1" then

' code here

end if

bruce barker

the best approach is to create a usercontrol, implement
IPostBackEventHandler and change the href to:

string href="javascript:Clear();" +

-- bruce (

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question