Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Setting onMouseOver and onMouseOut on dynamic objects (http://www.velocityreviews.com/forums/t774053-setting-onmouseover-and-onmouseout-on-dynamic-objects.html)

Robson Carvalho Machado 08-18-2004 03:41 PM

Setting onMouseOver and onMouseOut on dynamic objects
 
Dear friends,

Is there a way to set onMouseOver and onMouseOut on dynamic objects?

I need to create two javascript events:
onMouseOver="show_message(id)"
onMouseOut="show_message(id)"

My objects are created as follows:

Dim ID as String

ID = "hyperlink1"
Dim myHyperLink as HyperLink
myHyperLink = New HyperLink
myHyperLink.ID = ID
myHyperLink.ImageUrl = "http://localhost/img.gif"
PlaceHolder1.Controls.Add(myHyperLink)

ID = "image1"
Dim myImage as Webcontrols.Image
myImage = New WebControls.Image
myImage.ID = ID
myImage.ImageUrl = "http://localhost/"
PlaceHolder1.Controls.Add(myImage)

ID = "label1"
Dim myLabel as Label
myLabel = New Label
myLabel.ID = ID
myLabel.Text = "my label"
PlaceHolder1.Controls.Add(myLabel)





Mark Fitzpatrick 08-18-2004 11:11 PM

Re: Setting onMouseOver and onMouseOut on dynamic objects
 
Sure, use the Add method of the attributes collection like so:
myHyperLink.Attributes.Add("onMouseOver","show_mes sage(id)")

Of course, this has to be done before the control is added to the
placeholder.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Robson Carvalho Machado" <RobsonCarvalhoMachado@discussions.microsoft.com >
wrote in message news:D93EE0B9-314F-4CE4-8C5B-9BD12F0B0F7D@microsoft.com...
> Dear friends,
>
> Is there a way to set onMouseOver and onMouseOut on dynamic objects?
>
> I need to create two javascript events:
> onMouseOver="show_message(id)"
> onMouseOut="show_message(id)"
>
> My objects are created as follows:
>
> Dim ID as String
>
> ID = "hyperlink1"
> Dim myHyperLink as HyperLink
> myHyperLink = New HyperLink
> myHyperLink.ID = ID
> myHyperLink.ImageUrl = "http://localhost/img.gif"
> PlaceHolder1.Controls.Add(myHyperLink)
>
> ID = "image1"
> Dim myImage as Webcontrols.Image
> myImage = New WebControls.Image
> myImage.ID = ID
> myImage.ImageUrl = "http://localhost/"
> PlaceHolder1.Controls.Add(myImage)
>
> ID = "label1"
> Dim myLabel as Label
> myLabel = New Label
> myLabel.ID = ID
> myLabel.Text = "my label"
> PlaceHolder1.Controls.Add(myLabel)
>
>
>
>




Robson Carvalho Machado 08-19-2004 01:43 AM

Re: Setting onMouseOver and onMouseOut on dynamic objects
 
Dear Mark,

Thaks a lot.

"Mark Fitzpatrick" wrote:

> Sure, use the Add method of the attributes collection like so:
> myHyperLink.Attributes.Add("onMouseOver","show_mes sage(id)")
>
> Of course, this has to be done before the control is added to the
> placeholder.
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
>
> "Robson Carvalho Machado" <RobsonCarvalhoMachado@discussions.microsoft.com >
> wrote in message news:D93EE0B9-314F-4CE4-8C5B-9BD12F0B0F7D@microsoft.com...
> > Dear friends,
> >
> > Is there a way to set onMouseOver and onMouseOut on dynamic objects?
> >
> > I need to create two javascript events:
> > onMouseOver="show_message(id)"
> > onMouseOut="show_message(id)"
> >
> > My objects are created as follows:
> >
> > Dim ID as String
> >
> > ID = "hyperlink1"
> > Dim myHyperLink as HyperLink
> > myHyperLink = New HyperLink
> > myHyperLink.ID = ID
> > myHyperLink.ImageUrl = "http://localhost/img.gif"
> > PlaceHolder1.Controls.Add(myHyperLink)
> >
> > ID = "image1"
> > Dim myImage as Webcontrols.Image
> > myImage = New WebControls.Image
> > myImage.ID = ID
> > myImage.ImageUrl = "http://localhost/"
> > PlaceHolder1.Controls.Add(myImage)
> >
> > ID = "label1"
> > Dim myLabel as Label
> > myLabel = New Label
> > myLabel.ID = ID
> > myLabel.Text = "my label"
> > PlaceHolder1.Controls.Add(myLabel)
> >
> >
> >
> >

>
>
>



All times are GMT. The time now is 10:10 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57