0

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

3
Contributors
4
Replies
16
Views
3 Years
Discussion Span
Last Post by grafic.web
0

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

Edited by JorgeM

0

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?

0

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!!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.