How to: use SERVER controls to simulate HTML "link & button" rollo

C

charliewest

I am trying use server controls or web controls to simulate the following
behavior. I've an image wrapped w/in a link to create a rollover effect as
if both elements we're one graphic:

<a href="javascript:submit();"
onMouseOver="MM_swapImage('Image1221','','images/btn_green_on.gif',1)"
onMouseOut="MM_swapImgRestore()" id="A1" runat="server"> Next <img
src="images/btn_green.gif" alt="Next" name="Image1221" width="16" height="16"
border="0" align="absMiddle" id="Image1"></a>

The advantage of the above code is that when developing for multilingual
sites, i don't need to create a new graphic button for each language, but can
instead change the text "Next" to whatever language. Additionally, when
moving the mouse over the link, the link's CSS style changes the color, and
at the same time, the mouseover event changes the corresponding button's
image, making a rollover effect - the link/button combination appears to be
"one graphic".

I'm trying to simulate this using web controls so that i can wire-up the
controls to specific events via code-behind. i've tried...

<asp:LinkButton id="LinkButton1" runat="server">Next</asp:LinkButton>
<asp:ImageButton id="ImageButton1" runat="server"
onmouseover="this.src='images/btn_green_on.gif';"
onmouseout="this.src='images/btn_green.gif';"
ImageUrl="images/btn_green.gif"></asp:ImageButton>

....however, i cannot manage to make the LinkButton execute onmouseover
events so that the ImageButton looks like it's been "rolled over".

Is there any way to do this?
 
B

Bob Barrows [MVP]

charliewest said:
I am trying use server controls or web controls to simulate the
There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-savvy person here who can
answer your question, you can eliminate the luck factor by posting your
question to a newsgroup where the dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.

HTH,
Bob Barrows--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top