Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Change Background Color

Reply
Thread Tools

Change Background Color

 
 
shapper
Guest
Posts: n/a
 
      10-19-2006
Hello,

How can I change the background color of an Aspanel when the mouse is
over it?

Thanks,
Miguel

 
Reply With Quote
 
 
 
 
Siva M
Guest
Posts: n/a
 
      10-19-2006
In the Page Load event, have:

MyPanel.Attributes.Add ("onmouseover", "this.style.backgroundColor='red';");
// Mouse over color
MyPanel.Attributes.Add ("onmouseout",
"this.style.backgroundColor='white';"); // Restore default b/g color


"shapper" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
Hello,

How can I change the background color of an Aspanel when the mouse is
over it?

Thanks,
Miguel

 
Reply With Quote
 
 
 
 
Mahesh K. Anajni
Guest
Posts: n/a
 
      10-19-2006
hi

you have to write the following code on ItemCreated Event of Reapeater
control.

Private Sub Repeater1_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
Repeater1.ItemCreated
Dim rtpItem As ListItemType
Dim pnl As HtmlGenericControl
rtpItem = ListItemType.Item
If rtpItem = ListItemType.AlternatingItem Or rtpItem =
ListItemType.Item Then
pnl = CType(e.Item.FindControl("pnl"), HtmlGenericControl)
btn = CType(e.Item.FindControl("btn"), Button)
pnl.Attributes.Add("onmouseover",
"javascript:this.style.backgroundColor='red';" )
pnl.Attributes.Add("onmouseoutr",
"javascript:this.style.backgroundColor='white' ;")
End If
End Sub

MyPanel.Attributes.Add ("onmouseover",
"this.style.backgroundColor='red';");
// Mouse over color
MyPanel.Attributes.Add ("onmouseout",
"this.style.backgroundColor='white';"); // Restore default b/g color


Siva M wrote:
> In the Page Load event, have:
>
> MyPanel.Attributes.Add ("onmouseover", "this.style.backgroundColor='red';");
> // Mouse over color
> MyPanel.Attributes.Add ("onmouseout",
> "this.style.backgroundColor='white';"); // Restore default b/g color
>
>
> "shapper" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> Hello,
>
> How can I change the background color of an Aspanel when the mouse is
> over it?
>
> Thanks,
> Miguel


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
rounded corners in which my border color is different than the background color laredotornado@zipmail.com Javascript 1 02-14-2007 07:37 AM
not able to click on background tab and backgrounds in properties to change the background. rex Computer Support 2 12-06-2006 02:26 AM
Problem with setting background color alternating item in datalist to a certain color fig000 ASP .Net Web Controls 0 09-06-2004 06:51 PM
How do i change background color to transparent Ather Ali Shaikh ASP .Net 1 12-04-2003 07:00 PM



Advertisments