CrazyPaste CrazyPaste - 1 year ago 189
HTML Question

JavaScript error: Uncaught TypeError: a[b] is not a function

In my C# Webforms project I have a

control set to run a
function. Each time I select a date, I get this Javascript error:

Uncaught TypeError: a[b] is not a function

function SetDateSession() {

<telerik:RadDatePicker ID="StartDatePicker" runat="server">
<ClientEvents OnDateSelected="SetDateSession()" />

I can't figure out why this very simple code doesn't work. If I try to call the function with
from an
tag, it works.

<input type="button" id="RepBtn" onclick="SetDateSession()" value="View" runat="server"/>

Here is the console when I get the error:

enter image description here

I've simplified the code so much that it's hard for me to know what to try next.

Answer Source

What a waste of time on such a stupid thing! Basically this

<ClientEvents OnDateSelected="SetDateSession()" />

should be this

<ClientEvents OnDateSelected="SetDateSession" />

Lesson learned, Telerik! Thank you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download