Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control

前端 未结 4 1562
借酒劲吻你
借酒劲吻你 2020-11-30 07:33

I am getting the following error

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

<
4条回答
  •  庸人自扰
    2020-11-30 07:55

    The syntax is

    <%# Eval("...") %>
    

    You could do something like

    
    

    and in your codebehind:

    boolean ShowImg(string msg)
    {
         return (msg == HttpContext.Current.Profile.UserName);
    }
    

提交回复
热议问题