473,320 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

improved ImageButton does it exist?

Heelo,
I'm looking for a component that allow creating
a ImageButton slighlty imporved as
I wish It could change backggrtound image
with the following event;
onMouseOut onMouseOver onClick

I've done it done it that way using javascirpt in the html code:
-----------------------------------------------------
<a id="A1" href="#"
onMouseOut="MM_nbGroup('out');"
onMouseOver="MM_nbGroup('over','ImageButton1','bou ton_f2.gif','bouton_f3.gif',1);"
onClick="MM_nbGroup('down','navbar1','ImageButton1 ','bouton_f3.gif',1);">

<asp:ImageButton id="ImageButton1" style="Z-INDEX: 102; LEFT: 224px;
POSITION: absolute; TOP: 16px" runat="server" ImageUrl="bouton.gif">

</asp:ImageButton>

</a>
-----------------------------------------------------

but I imagine this control must exist somewhere?

Any help?

Thanks

Franck
Nov 19 '05 #1
1 1270
pretty trival to write. inherit from ImageButton, add a RolloverImageUrl
property (to set the rollover image), then in the render:
public class RolloverImageButton : ImageButton
{
string mRolloverImageUrl = "";

public string RolloverImageUrl
{
get {return mRolloverImageUrl ; }
set {mRolloverImageUrl = value; }
}

protected override void Render(HtmlTextWriter output)
{
if (RolloverImageUrl.Length > 0)
{
this.Attributes.Add("onmouseout",string.Format("th is.src='{0}',ImageUrl));
this.Attributes.Add("onmouseover",string.Format("t his.src='{0}',RolloverImageUrl));
}
base.Render(output);
}
}
-- bruce (sqlwork.com)
"Franck" <fh@fh.com> wrote in message
news:df**********@s1.news.oleane.net...
Heelo,
I'm looking for a component that allow creating
a ImageButton slighlty imporved as
I wish It could change backggrtound image
with the following event;
onMouseOut onMouseOver onClick

I've done it done it that way using javascirpt in the html code:
-----------------------------------------------------
<a id="A1" href="#"
onMouseOut="MM_nbGroup('out');"
onMouseOver="MM_nbGroup('over','ImageButton1','bou ton_f2.gif','bouton_f3.gif',1);"
onClick="MM_nbGroup('down','navbar1','ImageButton1 ','bouton_f3.gif',1);">

<asp:ImageButton id="ImageButton1" style="Z-INDEX: 102; LEFT: 224px;
POSITION: absolute; TOP: 16px" runat="server" ImageUrl="bouton.gif">

</asp:ImageButton>

</a>
-----------------------------------------------------

but I imagine this control must exist somewhere?

Any help?

Thanks

Franck

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chuck Hartman | last post by:
I've been trying to add an ImageButton object to a Calendar table cell, but so far I am unable to handle the Command event from that button in my form's code behind. Below is an example of what I...
3
by: Benjamin Gavin | last post by:
Hi all, I recently stumbled upon a bug in the ASP.NET framework handling of ImageButton based postbacks. The issues derives from the fact that IE and Mozilla handle the case of a missing image...
3
by: tshad | last post by:
I was trying to change my asp:button to asp:ImageButton, but got a message saying that ImageButton does not have an onClick function. How do I get the ImageButton call a function? Thanks, ...
1
by: Nathan Sokalski | last post by:
I want to create a pushbutton-like control on my webform that has an image on it. I used to think that this is what the ImageButton control was, but it seems to me that the ImageButton is nothing...
0
by: Oddball | last post by:
I have set up a page with uses two lots of image buttons, one for a collection and one for more images from that collection. I generate all the image buttons on page init (I know, but I...
3
by: jens.buchta | last post by:
Hi! I'm using a DataGrid with a template column to display an Image inside of it. I'm hooking into its OnPrerender-Event to set the ImageURL-Property dynamically. Everything works just fine...
0
by: MSDN | last post by:
How can you have an ImageButton on a page that will not react to the keyboard enter key on a web page. The ImageButton does not have property UseSubmitBehavoir to be set to False. Other buttons...
4
by: suzanne.boyle | last post by:
Hi, I'm adding an ImageButton as a child to a custom web control and attaching an event handler to it. When the page posts back the event is not being fired however. I initially assumed I had...
2
by: DC | last post by:
Hi, why does this not work: <asp:ImageButton id="myButt" runat="server" OnCommand="myButt_kick" ImageUrl="<% =GetMyButtUrl() %>" </asp:ImageButton>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.