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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top