Trying to get a reference to the Calendar

2 posts, 0 answers
  1. bo
    bo avatar
    26 posts
    Member since:
    Jan 2009

    Posted 13 Aug 2010 Link to this post

    simple little page here, but every time I select I get the javascript error $f is not defined.  All I'm trying to do is set the selected date of the calendar.
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="crud.aspx.cs" Inherits="Grid_crud" %>
    <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <head runat="server">
        <script language="javascript" type="text/javascript">
            function dummy() {
                var calendar = $find("<%= gridCalendar.ClientID %>");
                calendar.selectDate("05/10/2010", true);
        <form id="form1" runat="server">
            <radCln:RadCalendar ID="gridCalendar" runat="server">
            <button type="button" id="Select" style="margin-top: 10px; margin-right: 2px;" onclick="dummy();">
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Aug 2010 Link to this post


    From your code I can see that, you are using RadControls for ASP.NET version, not the Ajax version and you are referring the Ajax version documentation.

    You need to use the following code to get client side object.
        var calendar = <%= RadCalendar1.ClientID %>;

    And the relevant links are here:
    Client-Side API
    Client-Side API (Documentation)

Back to Top