开发者

How can i set a DataItem to some part of aspx code?

开发者 https://www.devze.com 2022-12-18 17:22 出处:网络
I have some code like this: <div><%# DataBinder.Eval(Container.DataItem, \"M_ClassProperty\") %></div>

I have some code like this:

<div><%# DataBinder.Eval(Container.DataItem, "M_ClassProperty") %></div>
<img src='<%# DataBinder.Eval(Container.DataItem, "M_AnotherClassProperty").To<string>()  %>'

but there is no component which wraps this code like Repe开发者_如何学Pythonater, DataList or something like that. How can set the set a DataItem to this code to show the values of an object of a class.

I hope i could tell clear (I don't think so but I HOPE :)


You can use normal inline code, like this:

<div> <%= SomeObject.SomeProperty.ToString() %></div>

To get an object, you can define a protected property in the code-behind page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号