Repeater not found in C# codebehind

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
 
P

Peter Rilling

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top