How to fix Error does not contain a definition for 'context' and no accessible extension method 'context' accepting a first argument type

Viewed 2228

I am using visual studio 2019 and i am working with grid view control and i am getting error:

Severity Code Description Project File Line Suppression State Error CS1061 'admin_register_qc_team_default_aspx' does not contain a definition for 'Context' and no accessible extension method 'Context' accepting a first argument of type 'admin_register_qc_team_default_aspx' could be found (are you missing a using directive or an assembly reference?) 4_Admin_Register_QC_Team_Default.aspx D:\Balco_QC (2)\Balco_QC\Balco_QC\Admin\Register_QC_Team\Default.aspx 231 Active

initially i din't face error, my code was working but after some changes in grid view i am getting this error

Don't know why this error comes after a hours again and again

<asp:UpdatePanel ID="upd" runat="server" UpdateMode="Always">
  <ContentTemplate>
       <asp:GridView runat="server" ID="grdRegister" class="table table-striped table-bordered" AutoGenerateColumns="false">
           <Columns>
               <asp:TemplateField HeaderText="ID" ItemStyle-Width="30">
               <ItemTemplate>
               <asp:Label runat="server" Text='<%# Eval("ID") %>' ID="lblID"></asp:Label>
               </ItemTemplate>
            </asp:TemplateField>
                <asp:TemplateField HeaderText="Employee Type" ItemStyle-Width="150">
               <ItemTemplate>
                   <asp:DropDownList ID="ddlEmployeeType" runat="server" class="form-control" AutoPostBack="true" OnSelectedIndexChanged="ddlPub_SelectedIndexChanged">
                        <asp:ListItem Value="">--Select--</asp:ListItem>
                        <asp:ListItem Value="Employee">Employee</asp:ListItem>
                        <asp:ListItem Value="Contractor">Contractor</asp:ListItem>
                   </asp:DropDownList>
                </ItemTemplate>
           </asp:TemplateField>
           </Columns>
       </asp:GridView>
   </ContentTemplate>
</asp:UpdatePanel>

Please help me any idea ?? I am getting error in Label Control (Eval) and i deleted whole line and again write same I do following:

Clean solution in VisualStudio

Close VisualStudio

Delete all "bin" and "obj" Folders (from the whole solution) manually

Delete "packages" Folder manually

Restart VisualStudio

Rebuild all but no any changes

0 Answers
Related