User-203096317 posted
I am writing a custom composite control. Using an embedded .js file and attributes i can my control (primarily a textbox) to behave as expected. I have added the following attributes to the control during the OnInit event of the control.
Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
MyBase.OnInit(e)
Me.Attributes.Add("onkeydown", "javascript:return fName(this, event);")
End Sub
the function fName is in my javascript file and returns the expected result.
The problem i am having is when i attempt to add an attribute for "ondrop" instead of the onkeydown event, nothing happens. The event doesn't seem to be firing.
Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
MyBase.OnInit(e)
Me.Attributes.Add("ondrop", "javascript:return fName(this, event);")
End Sub
If i use my control in a page and add the attribute to fire on the onDrop event maunally during the page load to a specified instance of my control it works as expected.
I've tried variations of upper and lower case but no joy. Does anyone know how i can fix this or give me a reason why it doesn't seem to work?
thanks.