0
<asp:Repeater ID="rep1" runat="server" >
    <ItemTemplate>
                                               
       <%if ((Eval("Member_ID").ToString()) == Session["StuID"].ToString()) {%>
...some code

but when I run the code this error message appears:

System.InvalidOperationException: 'Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.' This exception was originally thrown at this call stack: [External Code] ASP.adminsection_empchat_aspx.__Render__control4(System.Web.UI.HtmlTextWriter, System.Web.UI.Control) in EmpChat.aspx [External Code]

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
  • 1
    Any question here on SO is very important. Why should yours be more important than the others? ;o) – Sir Rufo Dec 30 '21 at 18:29
  • Does [Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control](https://stackoverflow.com/questions/2571545/databinding-methods-such-as-eval-xpath-and-bind-can-only-be-used-in-the) help? – Andrew Morton Dec 30 '21 at 18:33
  • Does this answer your question? [Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control](https://stackoverflow.com/questions/2571545/databinding-methods-such-as-eval-xpath-and-bind-can-only-be-used-in-the) – nighthawk Jan 08 '22 at 09:13

0 Answers0