Nida
Nida

Reputation: 1702

Issue while using ajax calendar

I am using Ajax calendar in an ASP.NET application like below lines of codes

<asp:TextBox ID="txtDOB" placeholder="(mm/dd/yyyy)" runat="server" onchange="ValidateDate()">
</asp:TextBox>

<ajax:CalendarExtender ID="txtDOBCalendar" runat="server" Format="mm/dd/yyyy" TargetControlID="txtDOB">
</ajax:CalendarExtender>

It is not working. It throws error message like

"The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."

Upvotes: 0

Views: 66

Answers (1)

Vicky_Burnwal
Vicky_Burnwal

Reputation: 981

I guess there must be some code block <%= ...%>. Replace it with <%# ...%>. Hope it helps.

Upvotes: 1

Related Questions