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

Discussion in 'ASP General' started by charliewest, Jan 20, 2005.

  1. charliewest

    charliewest Guest

    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?
     
    charliewest, Jan 20, 2005
    #1
    1. Advertising

  2. charliewest wrote:
    > 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.
     
    Bob Barrows [MVP], Jan 20, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2lhag==?=
    Replies:
    7
    Views:
    1,492
    =?Utf-8?B?c2lhag==?=
    Mar 7, 2005
  2. mike
    Replies:
    5
    Views:
    973
    Keith M. Corbett
    Sep 21, 2004
  3. Suzanne

    Problems with Link Button and Button web controls

    Suzanne, Dec 3, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    159
    Suzanne
    Dec 3, 2003
  4. brian

    HTML Server Controls vs Web Server Controls

    brian, Jan 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    312
    Steve C. Orr [MVP, MCSD]
    Jan 24, 2005
  5. Napoleon
    Replies:
    2
    Views:
    105
    Napoleon
    Nov 21, 2007
Loading...

Share This Page