refer to this artlicle
Changing GridView Row Color OnMouseOver
http://www.gridviewguy.com/ArticleDetails.aspx?articleID=172
You can refer it to datalist as well but need to workout a bit
hope this helps
Hi philmccracken,
I tried to give you an example. I created the page below where the buttons will come and go depending on the mouseover event. i didn't fix the color of the <div> yet. I hope this helps
<%
@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %><!
DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><
htmlxmlns="http://www.w3.org/1999/xhtml"><
headrunat="server"><title>Untitled Page</title></
head><
body><formid="form1"runat="server"><atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering=true/><div><atlas:UpdatePanelID="Panel"Mode="Conditional"runat="server"><ContentTemplate><divid="first"style="background:yellow"onmouseout="HideButton()"onmouseover="ShowButton()"><inputid="Button"value="button"type="button"Visible="false"/></div></ContentTemplate></atlas:UpdatePanel></div></form><scriptlanguage="javascript">var div;function pageLoad(){
this.HideButton();}
function ShowButton(){
var btn =new Sys.UI.Button($('Button'));btn.initialize();
btn.set_visible(
true);}
function HideButton(){
var btn =new Sys.UI.Button($('Button'));btn.initialize();
btn.set_visible(
false);}
</script><scripttype="text/xml-script"><page xmlns:script=
"http://schemas.microsoft.com/xml-script/2005"><references>
</references>
<components>
</components>
</page>
</script></
body></
html>PERFECT! Exactly what I was looking/hoping for. I am in your debt, kind sir.

Hey kids,
My boss decided he wants a clickable image and not a regular button. So I converted the button to a hyperlink (I tried both an htmlanchor with an img as well as a .net hyperlink with imageurl), but for the life of me, I can't get the hyperlink to show/hide on mouseover). I tried poking around in the client docs for sys.ui.hyperlink and sys.ui.image, but I must be retarded. Any ideas?
How about an example with an imagebutton or hyperlink/image. I wouldn't be opposed to an imagebutton - that would output an html input tag with type=image right? would sys.ui.button still work for that?
Much obliged!
Oh yeahhhhhhhhhhh. Answered my own question. The original Sys.Ui.Button code works for an imagebutton as well.
No comments:
Post a Comment