Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
if (Request.QueryString["SelectValue"].ToString() == "Cache" && Eval("LOADIND").ToString().Trim() == "EF")
{ %>
<a href="../Home/AddMaterialDraft.aspx?Spirid=<%# Eval("ID") %>&project= <%# Eval("NAME") %>">
<img src="../Images/change.png" style="height: 30px; width: 30px" /></a>
<% } %>

Above code is used in my aspx page. first condition value coming from session so no problem is occured but the second condition is value from datatable in if statement.now i run my code below error is occur :
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

What I have tried:

How to fix this.the if statement is inside the repeater.
Posted
Updated 5-Jan-17 19:10pm
v2

1 solution

need your complete HTML for repeater... seems like you are using snippets in wrong place
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900