This is a migrated thread and some comments may be shown as answers.

Setting Appointment onmouseover Attribute in Server Side Code

2 Answers 57 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael Hunt
Top achievements
Rank 1
Michael Hunt asked on 10 Sep 2010, 05:11 PM
Hi,

I'm using the latest version of the controls (2010.2.826.35).

I know I can set the Appointment's onmouseover attribute in client-side code (by using app.get_element().onmouseover), but I really want to do it in server-side code.

In the server-side AppointmentCreated event I've tried the following, but it does nothing:

 

  Dim jscript As String = "javascript:alert('hello');"

 

  e.Appointment.Attributes.Add(

"OnMouseOver", jscript)

Also, when I view the page's source, there are no OnMouseOver attributes.

Can I set an Appointment's OnMouseOver attribute from server-side code?

Thanks,
Michael

 

2 Answers, 1 is accepted

Sort by
0
Michael Hunt
Top achievements
Rank 1
answered on 10 Sep 2010, 05:27 PM
Actually, I've figured it out.  Using the following in the AppointmentCreated method,

  e.Appointment.AppointmentControls(0).Attributes.Add("onmouseover", "alert('hello');")

But is this the recommended way to do it?  I don't want to do something that might be "broken" in future releases.

Thanks,
Michael

0
Peter
Telerik team
answered on 15 Sep 2010, 02:40 PM
Hi Michael,

That approach seems fine to me and it is not likely to fail in future versions. I would recommend the same code as well.


Best wishes,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler
Asked by
Michael Hunt
Top achievements
Rank 1
Answers by
Michael Hunt
Top achievements
Rank 1
Peter
Telerik team
Share this question
or