How to fix: cs1061 error dealing with Control and Dataitem

131 views Asked by At

This is my code line: <asp:TextBox Text='<%#DataBinder.Eval(Container.DataItem,"Date", "{0:MM/dd/yyyy}")%>' ID="txtDate" runat="server" placeholder="Date" class="form-control"></asp:TextBox>

It shows error cs1061 "'Control' does not contain a definition for 'DataItem' and no accessible extension method 'DataItem' accepting a first argument of type 'Control' could be found (are you missing a using directive or an assembly reference?)" 

How do I fix it???

0

There are 0 answers