K
K Viltersten
I have the following script consisting of
three script-sections.
<% if (true) { %>
<%# MyLogic.GetName(
DataBinder.GetPropertyValue((List<MyInfo>)
Container.DataItem)[0], "PropName")) %>
<% } %>
I'd like to make it into a single one, similarly
to the example below. The name Container isn't
recognized, the computer tells me, though.
<%
if (true) {
MyLogic.GetName(
DataBinder.GetPropertyValue(((List<MyInfo>)
Container.DataItem)[0], "PropName"));
}
%>
What do i miss? What's the exact syntax here?
(I know that the best choice is to do that from
code behind and i intend to solve it that way.
However, i'm curious of how to make the above
work without code behind. It IS doable, right?)
three script-sections.
<% if (true) { %>
<%# MyLogic.GetName(
DataBinder.GetPropertyValue((List<MyInfo>)
Container.DataItem)[0], "PropName")) %>
<% } %>
I'd like to make it into a single one, similarly
to the example below. The name Container isn't
recognized, the computer tells me, though.
<%
if (true) {
MyLogic.GetName(
DataBinder.GetPropertyValue(((List<MyInfo>)
Container.DataItem)[0], "PropName"));
}
%>
What do i miss? What's the exact syntax here?
(I know that the best choice is to do that from
code behind and i intend to solve it that way.
However, i'm curious of how to make the above
work without code behind. It IS doable, right?)