System.ArgumentNullException occurred. Kindly help. ?

Asked By 0 points N/A Posted on -
qa-featured

 I am having an ajax toolkit calendar extender with the code below:

<asp:TextBox ID="txtStartDate" runat="server" CssClass="textbox" ToolTip="Enter the Start Date"></asp:TextBox>

<asp:Image ImageUrl="/images/cal.gif" runat="server" ID="imgStartDate" ToolTip="Please Pick/Enter a StartDate" />

<ajaxToolkit:CalendarExtender TargetControlID="txtStartDate" PopupButtonID="imgStartDate"
runat="server" ID="CalendarExtender1" PopupPosition="Right" Format="dd/MM/yyyy">
</ajaxToolkit:CalendarExtender>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="Submit"
Text="*Start Date is required" ControlToValidate="txtStartDate" Display="Static">

</asp:RequiredFieldValidator>

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtStartDate"
ValidationExpression="(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)dd"
ErrorMessage="* Your entry is not a valid Start Date(dd/mm/yyyy)." Display="dynamic"
ValidationGroup="Submit">

</asp:RegularExpressionValidator>

<ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
TargetControlID="txtStartDate" WatermarkCssClass="watermarked" WatermarkText="Enter the Start Date(dd/mm/yyyy)">
</ajaxToolkit:TextBoxWatermarkExtender>
 

When I load the page, it displays the following error:

Error: Sys.ArgumentNullException: Value cannot be null

Parameter name: element

SHARE
Answered By 0 points N/A #117579

System.ArgumentNullException occurred. Kindly help. ?

qa-featured

I am proposing a solution to this problem, but bear in mind that it may not be as exactly perfect. Altogether, you can give it a trial.

Value cannot be null.

Try adding the HTML page like this:

<ajaxtoolkit:modalpopupextender ID="MPE" runat="server" TargetControlID="btnShow"PopupControlID="pnlUserControl"/>

<asp:panel ID="pnlUserControl">

<uc1:myusercontrol id="userControl1" runat="server" />

</asp:panel>

And more additions on your user control front.

Maybe something on: protected void page_load.

Cheers!

Related Questions