|
-
Jan 21st, 2004, 09:11 AM
#1
Thread Starter
Frenzied Member
imagebutton rollover in a repeater
I have some image buttons in a repeater that i want to have rollover images.
In the past i've done this with static imagebuttons by adding:
VB Code:
btnLogin.Attributes.Add("OnMouseOver", "this.src='images/Login_over.gif';")
btnLogin.Attributes.Add("OnMouseOut", "this.src='images/login_out.gif';")
To the page_load event.
How can i create a rollover image for an imagebutton thats in a repeater?
Cheers,
Tom.
-
Jan 22nd, 2004, 07:44 PM
#2
Lively Member
Basically it is the same thing.
You write the code for something like OnItemCreated or ItemDataBound event and use Item.FindControl function to get reference for every ImBut control and apply add attribute
-
Jan 23rd, 2004, 05:15 AM
#3
Thread Starter
Frenzied Member
Thanks a lot split, actually a lot easy than i thought in the end. I Ended up putting the code in the on_load event for the imagebutton as such
VB Code:
Sub ImageButton_Load(ByVal sender As Object, ByVal e As System.EventArgs)
sender.Attributes.Add("OnMouseOver", "this.src='../images/enter_next_round_over.gif';")
sender.Attributes.Add("OnMouseOut", "this.src='../images/enter_next_round.gif';")
End Sub
And everything works great, still very much getting used to asp.net but really liking it so far.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|