NullReferenceException: Object reference not set to an instance of an object in ajaxcontroltoolkit?
<p>I have coded as shown below and also I have included TargetControlID in MaskedEditExtender Tag but I am getting as NullReferenceException: </p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="Employee_Managment.Register" %&gt;

&lt;%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %&gt;
&lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %&gt;
&lt;!DOCTYPE html&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;link href="../Styles/bootstrap.min.css" rel="stylesheet" /&gt;
&lt;/head&gt;
&lt;body&gt;


         &lt;asp:ScriptManager runat="server" ID="ScriptManager1" EnableScriptGlobalization="true"&gt;&lt;/asp:ScriptManager&gt;
        &lt;%--&lt;asp:TextBox runat="server" ID="autocompletetest"&gt;&lt;/asp:TextBox&gt;
        &lt;ajax:AutoCompleteExtender runat="server" EnableCaching="false" CompletionInterval="10" MinimumPrefixLength="2" CompletionSetCount="3" TargetControlID="autocompletetest" ServiceMethod="NamePick" FirstRowSelected="false"&gt;&lt;/ajax:AutoCompleteExtender&gt;
        &lt;asp:Label runat="server" ID="label"&gt;&lt;/asp:Label&gt;--%&gt;
        &lt;asp:TextBox ID="TextBox3" runat="server" Width="150px"&gt;&lt;/asp:TextBox&gt;        
        &lt;ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" MaskType="None" Mask="9999" TargetControlID="TextBox3"&gt;
        &lt;/ajax:MaskedEditExtender&gt;
        &lt;%--&lt;ajax:MaskedEditValidator ID="MaskedEditValidator2" runat="server" ControlToValidate="TextBox3" ControlExtender="MaskedEditExtender2" Display="Dynamic" IsValidEmpty="false" InvalidValueMessage="Invalid date!" EmptyValueMessage="The date is not entered"&gt;
        &lt;/ajax:MaskedEditValidator&gt;   --%&gt;


&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I am getting error as shown below:</p>

<pre><code>[NullReferenceException: Object reference not set to an instance of an object.]
   AjaxControlToolkit.MaskedEditExtender.OnLoad(EventArgs e) +183
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2952
</code></pre>

<p>Kindly comment the solution.</p>