Hi, i applyed an CalendarExtender to my text box, this is the code :

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server" 
            Enabled="True" TargetControlID="TextBox1">
        </asp:CalendarExtender>

    </div>
    </form>
</body>
</html>

but when i run it, i get this error :

"Erreur d’exécution JavaScript: Impossible d’obtenir la propriété « UI » d’une référence null ou non définie"

<script type="text/javascript">
//<![CDATA[
Sys.Application.add_init(function() {
    $create(Sys.Extended.UI.CalendarBehavior, {"id":"TextBox1_CalendarExtender"}, null, null, $get("TextBox1"));
});
//]]>
</script>

What did i do wrong?
THANKS

View
Please review my previous thread.
Might help you. :)

Regarding your error... "JavaScript runtime error: Unable to get the "UI" property of a null reference or undefined"

I dont see that you registered the AjaxControlToolkit at the top of the page?

Take a look at this thread on the asp.net support site.

http://forums.asp.net/t/1926083.aspx

Yes i did registered the AjaxControlToolkit at the top of the page, this is the full code :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server" 
            Enabled="True" TargetControlID="TextBox1">
        </asp:CalendarExtender>
    </div>
    </form>
</body>
</html>

it should be ok, What is missing?

Ok!!! i understood where the problem is!!!!

I did add a ScriptManager in stead of an ToolkitScriptManager!!!

I add the ToolkitScriptManager and now i working!!!!

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>

Thanks for your help JorgeM!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.