The name 'Container' does not exist in the current context

A

Arjen

Hi,

I do this inside a repeater:
<% if ((Boolean)((DataRowView)Container.DataItem)["Image"] == true) { %>

<%} %>

I get this message:
CS0103: The name 'Container' does not exist in the current context

I need to check this...How can I fix this?
Thanks!
 
G

Guest

The "container" property only exists at the moment when that ItemTemplate is
databinding....not before and not after.
the

<%
code code code
%>

construct gets evaluated when the page is being rendered. So, when that
code is executing, the container does not exist
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top