首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >ASP.NET中如何使用BIND/Eval?

ASP.NET中如何使用BIND/Eval?

提问于 2018-01-26 00:14:02
回答 2关注 0查看 349

希望根据来自绑定的值添加一个if语句:

代码语言:txt
复制
<% if(bool.Parse(Eval("IsLinkable") as string)){ %>                    
        monkeys!!!!!!
        (please be aware there will be no monkeys, 
        this is only for humour purposes)
 <%} %>

IsLinable是来自绑定者的一个bool:

代码语言:txt
复制
InvalidOperationException
Databinding methods such as Eval(), XPath(), and Bind() can only
be used in the context of a databound control.

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档