Is there a way to use a DataBinder.Eval statement as an index of a specific array in an ASPX page?

橙三吉。 提交于 2019-12-11 04:59:05

问题


Is there a way to use a DataBinder.Eval statement as an index of a specific array in an ASPX page?

I'm trying to develop a page containing a list of bibliographic references, for which I'm using the ASP.NET 2.0 Repeater control.

I'm quite new to ASP.NET, so I've carefully read the various answers about Formatting DataBinder.Eval data and using values within if conditions in mark up which both deal with the usage of DataBinder.Eval statements, but I'm stuck with my array (which is called Refbib() )...

I tried this :

<%# RefBib(System.Convert.ToInt32((DataBinder.Eval(Container.DataItem, "id")!="") ? DataBinder.Eval(Container.DataItem, "id"):0))%>

for which I received an error message BC30203: Identifier expected

Could someone explain what is wrong in my syntax?

来源:https://stackoverflow.com/questions/12006141/is-there-a-way-to-use-a-databinder-eval-statement-as-an-index-of-a-specific-arra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!