title: The name does not exist in the current context (ItemTemplate)
body: <p>I have some controls within an ItemTemplate on my ASP.NET page. However, I can't access these controls in my code-behind file. I simply get this error:</p>
  
  <blockquote>
    <p>The name  does not exist in the current context</p>
  </blockquote>
  
  <p>It works if I add controls that aren't inside my ItemTemplate, so I assume there's something else I need to do in order to access these ItemTemplate controls. So how can I get access to these controls in my aspx.cs file?</p>
  
  <p>The code:</p>
  
  <pre><code>                &lt;ItemTemplate&gt;
                      &lt;div class="headline"&gt;
                          &lt;h2&gt;
                              &lt;asp:Label ID="lblGameTitle" runat="server" Text='&lt;%#Eval("GameTitle") %&gt;'&gt;&lt;/asp:Label&gt;&lt;/h2&gt;
                          &lt;div class="blog"&gt;
                              &lt;div class="blog-post-tags" style="padding-top: 5px"&gt;
                                  &lt;ul class="list-unstyled list-inline blog-info"&gt;
                                      &lt;li&gt;&lt;i class="fa fa-globe"&gt;&lt;/i&gt; Produsent:
                                      &lt;asp:Label ID="lblGamePublisher" runat="server" Text='&lt;%#Eval("GamePublisher") %&gt;'&gt;&lt;/asp:Label&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;i class="fa fa-calendar"&gt;&lt;/i&gt; Utgivelsesdato:
                                      &lt;asp:Label ID="lblGameReleaseDate" runat="server" Text='&lt;%#Eval("GamePublishedDate") %&gt;'&gt;&lt;/asp:Label&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;i class="fa fa-tag"&gt;&lt;/i&gt; Sjanger:
                                      &lt;asp:Label ID="lblGameGenre" runat="server" Text='&lt;%#Eval("GenreName") %&gt;'&gt;&lt;/asp:Label&gt;&lt;/li&gt;
                                  &lt;/ul&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-5"&gt;
                              &lt;asp:Image ID="imgGameImage" runat="server" ImageUrl='&lt;%#Eval("GameImagePath") %&gt;' Height="100%" Width="100%" /&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-7"&gt;
                              &lt;div class="row"&gt;
                                  &lt;div class="tag-box tag-box-v6"&gt;
                                      &lt;asp:Button ID="btnRentGame" class="btn-u btn-u-lg btn-u-orange" runat="server" Text="Lei spill" /&gt;&lt;/p&gt;
                                       &lt;div id="errorNoAccount" runat="server" class="alert alert-info fade in"&gt;
                                           &lt;button type="button" class="close" data-dismiss="alert" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                                           &lt;h4&gt;Ops!&lt;/h4&gt;
                                           &lt;p&gt;For å leie spill, må du registrere en bruker og ha et aktivt abonnement.&lt;/p&gt;
                                           &lt;p&gt;
                                               &lt;a class="btn-u btn-u-xs btn-u-default" href="#"&gt;Bli medlem&lt;/a&gt;
                                           &lt;/p&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="tag-box tag-box-v6"&gt;
                                      &lt;asp:Label ID="lblGameDescription" runat="server" Text='&lt;%#Eval("GameDescription") %&gt;'&gt;&lt;/asp:Label&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;br /&gt;
                          &lt;div class="col-md-12"&gt;
                              &lt;div class="panel panel-u"&gt;
                                  &lt;div class="panel-heading"&gt;
                                      &lt;h3 class="panel-title"&gt;&lt;i class="fa fa-video-camera"&gt;&lt;/i&gt;Trailer&lt;/h3&gt;
                                  &lt;/div&gt;
                                  &lt;div class="panel-body" style="height: 100%"&gt;
                                      &lt;div class="responsive-video"&gt;
                                          &lt;iframe style="border: none; width: 100%; height: 100%" src='&lt;%# "//www.youtube.com/embed/" + Eval("GameTrailer") + "?rel=0&amp;showinfo=0&amp;iv_load_policy=3" %&gt;' allowfullscreen&gt;&lt;/iframe&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/ItemTemplate&gt;
  </code></pre>