Asp.Net Ajax Error: Microsoft JScript runtime error: Unable to get value of the property ‘UI’: object is null or undefined

Most of the AJAX beginners get the ERROR: “Microsoft JScript runtime error: Unable to get value of the property ‘UI’: object is null or undefined” while running his project. There are lot of reasons behind it. But here i will share you with my recent experience while debugging one of my junior team member project. In this article i will share you the error reason & the resolution:

Lets say we want to develop a Autocomplete extender. So i can prepare my HTML like below:

<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <asp:Label runat="server" ID="lblReferrerName" Text="Referrer: "></asp:Label>
    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>

    <asp:AutoCompleteExtender ID="txtName_AutoCompleteExtender" runat="server" 
        DelimiterCharacters="" Enabled="True" ServiceMethod="GetCompletionList" 
        ServicePath="" TargetControlID="txtName" UseContextKey="True" MinimumPrefixLength="2" CompletionInterval="10" EnableCaching="true" CompletionSetCount="3">
    </asp:AutoCompleteExtender>

Now run the project & you will get the error: “Microsoft JScript runtime error: Unable to get value of the property ‘UI’: object is null or undefined“.

Microsoft jscript runtime error

Solution:
Here we use Ajax Control ToolKit but use Ajax Extensions Script Manager. Problem is here. Replace the Ajax Extensions Script Manager to Ajax Control ToolKit “ToolkitScriptManager” like below:

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

Hope your problem will be resolved.

Leave a Reply

Your email address will not be published. Required fields are marked *

AlphaOmega Captcha Classica  –  Enter Security Code