Repeater not found in C# codebehind

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

hi,

"The type or namespace of 'Repeater1' could not be found..." when I try and
bind a repeater in the Page_Load event using Repeater1.DataSource = table etc.

It's all basic stuff copied from a book. The only reason I'm posting is that
the page class inherits from another one which is based on System.Web.UI.Page.

i.e. page.aspx -> page.aspx.cs (inherits websearch)
websearch.cs - class inherits from System.Web.UI.Page.

This allows me to use a standard library in every page that inherits from the
websearch class but still access all the Page objects in the codebehind.

*But* is there something I need to add to reference aspx objects like my
repeater? BTW my page can access all my class properties etc.

thanks,

Jon
 
Make sure that you have a protected member variable that you can access.
Using server-side controls requires both the HTML and a variable that can be
referenced in code. Sometimes the IDE does not include the variable in the
code-behind.
 

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

Back
Top