0

I am using vs 2015 update 3, I created a website but while writing a code i get this error which says,

“The name 'control' does not exists in the current context”.

this control inside grid-view control I would like if you can help me to understand the error and tell me how I can fix it.

This is my grid-view :

 <div id="mainform">
 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
     <Columns>
       <asp:TemplateField Visible="false">
           <ItemTemplate>
            <asp:Label ID="lblProID" Visible="false" runat="server" Text='<%# Eval("ID")%>' />
             </ItemTemplate>
       </asp:TemplateField>
       <asp:TemplateField HeaderText="projects" ItemStyle-Width="150" >
           <ItemTemplate>
             <asp:Label ID="lblProjectName" runat="server" Text='<%# Eval("ProjectName")%>'></asp:Label>
            </ItemTemplate>
         <EditItemTemplate>
            <asp:TextBox ID="txtProjectName" runat="server" Text='<%# Eval("ProjectName") %>'></asp:TextBox>
         </EditItemTemplate>
        </asp:TemplateField>
        </Columns>
 </asp:GridView>

when i call or write lblProjectName it give me this error that i mentioned it before

The name does not exists in the current context

hashim
  • 69
  • 1
  • 14
  • 1
    Please add your code also. – Esko Dec 29 '16 at 13:34
  • 1
    Possible duplicate of [Name does not exist in the current context](http://stackoverflow.com/questions/19027025/name-does-not-exist-in-the-current-context) – M. Wiśnicki Dec 29 '16 at 13:35
  • you'll need to access it via rows property for this grid view, using row index and then try to search for this control in the row cells this is a possible solution to your question if I understood correctly http://stackoverflow.com/questions/1965835/find-control-inside-grid-row – Maha Khairy Dec 29 '16 at 13:41
  • i update my question – hashim Dec 29 '16 at 14:32

0 Answers0