【发布时间】:2011-08-01 13:47:56
【问题描述】:
在我的 .aspx 中,我希望根据来自绑定的值添加一个 If 语句。我尝试了以下方法:
<% if(bool.Parse(Eval("IsLinkable") as string)){ %>
monkeys!!!!!!
(please be aware there will be no monkeys,
this is only for humour purposes)
<%} %>
IsLinkable 是来自 Binder 的布尔值。我收到以下错误:
InvalidOperationException
Databinding methods such as Eval(), XPath(), and Bind() can only
be used in the context of a databound control.
【问题讨论】:
标签: c# if-statement eval bind webforms