title: using eval in server side code on asp.net page
body: <pre><code>&lt;asp:Repeater ID="rptrParent" runat="server"&gt;
  &lt;ItemTemplate&gt;
          &lt;li&gt;
              &lt;a href="&lt;% =ResolveUrl("~/cPanel/UserView.aspx?User=")%&gt;&lt;%# Eval("StudentUserName") %&gt;"&gt;
                  &lt;span&gt;
                      &lt;%  ProfileCommon pc = new ProfileCommon();
                          pc.GetProfile(Eval("StudentUserName").ToString());
                          Response.Write(pc.FirstName + "" + pc.LastName);
                      %&gt;
                  &lt;/span&gt;
              &lt;/a&gt;
          &lt;/li&gt;
  &lt;/ItemTemplate&gt;
  </code></pre>
  
  <p></p>
  
  <p>The following error</p>
  
  <pre><code>Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
  </code></pre>
  
  <p>is coming in this part</p>
  
  <pre><code>&lt;%  ProfileCommon pc = new ProfileCommon();
      pc.GetProfile(Eval("StudentUserName").ToString());
      Response.Write(pc.FirstName + "" + pc.LastName);
  %&gt;
  </code></pre>