我如何从codebehind调用Eval()?我知道这是像DataBinder.Eval(Container.DataItem,“name”)这样的前端快捷方式,但是我无法得到这个坏的东西来编译。我想,我错过了正确的方法参数。我想转一下这样的东西:
<asp:Image ID="imglogo" runat="server" ImageUrl='<%# Eval("name") %>'/>
成:
<asp:Image ID="imglogo" runat="server" ImageUrl='<%# GetimagePath(???) %>'/>
w /代码隐藏:
protected string GetimagePath(????) { //some code return "some/logical/path" + Eval("name"); }
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。