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

Trying to get a reference to the Calendar

1 Answer 62 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
bo
Top achievements
Rank 1
bo asked on 13 Aug 2010, 09:42 PM
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
 
    <script language="javascript" type="text/javascript">
        function dummy() {
            var calendar = $find("<%= gridCalendar.ClientID %>");
            calendar.selectDate("05/10/2010", true);
        }
    </script>
 
    <form id="form1" runat="server">
    <div>
        <radCln:RadCalendar ID="gridCalendar" runat="server">
        </radCln:RadCalendar>
        <button type="button" id="Select" style="margin-top: 10px; margin-right: 2px;" onclick="dummy();">
            Select</button>
    </div>
    </form>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Aug 2010, 06:57 AM
Hello,


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)


-Shinu.
Tags
Calendar
Asked by
bo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or