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

Discussion in 'ASP .Net' started by Arjen, Aug 21, 2006.

  1. Arjen

    Arjen Guest

    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!
    Arjen, Aug 21, 2006
    #1
    1. Advertising

  2. 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

    "Arjen" wrote:

    > 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!
    >
    >
    >
    =?Utf-8?B?RGF2aWQgSmVzc2Vl?=, Aug 21, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWljaGFlbA==?=

    The name 'UserName' does not exist in the current context"?

    =?Utf-8?B?TWljaGFlbA==?=, Oct 26, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    811
    Mark Fitzpatrick
    Oct 26, 2006
  2. J055
    Replies:
    3
    Views:
    3,423
  3. Montand
    Replies:
    1
    Views:
    538
    Alexey Smirnov
    Feb 20, 2008
  4. Peter Morris
    Replies:
    2
    Views:
    6,598
    Peter Morris
    Mar 17, 2008
  5. avecreep
    Replies:
    0
    Views:
    563
    avecreep
    Aug 5, 2008
Loading...

Share This Page