Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 852747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:38:58+00:00 2026-05-15T07:38:58+00:00

I’m just starting a new project and I am getting some really weird stuff

  • 0

I’m just starting a new project and I am getting some really weird stuff happening.

ASP.NET 3.5, VS2008.

I’ve tried rebuild, close VS, delete everything and get from svn again but I cannot understand why the repeater in the following is null on page_load.

I know this is going to be a headslapping moment. Help me out?

Markup:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GalleryControl.ascx.cs" Inherits="Site.UserControls.GalleryControl" %>
<asp:Repeater ID="rptGalleries" runat="server">
    <HeaderTemplate><ul></HeaderTemplate>
    <ItemTemplate>
       <li>wqe</li>
    </ItemTemplate>
    <FooterTemplate></ul></FooterTemplate>
</asp:Repeater>

Code behind

public partial class GalleryControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        rptGalleries.DataSource = new[] {1, 2, 3, 4, 5};
        rptGalleries.DataBind();
    }
}

Designer:

  public partial class GalleryControl {

    /// <summary>
    /// rptGalleries control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Repeater rptGalleries;
}

Why is my repeater null? What the F is going on?

The referencing page has this:

<ux:GalleryControl runat="server" ID="uxGalleryControl"/>

The web.config has this (I’ve never had to do this before but my masterpage was complaining about not finding another user control).

<add tagPrefix="ux" namespace="Site.UserControls" assembly="Site" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:38:59+00:00Added an answer on May 15, 2026 at 7:38 am

    After hours of head banging I have finally figured this out.

    I was referencing the User controls in the web config as stated (I also tried the Register method with the Assembly). I think there’s a weirdness with this method when the controls are in the same assembly. So referencing them like this:

    <%@ Register Src="~/UserControls/GalleryControl.ascx" TagPrefix="ux" TagName="GalleryControl" %>
    

    Worked immediately.

    I hope anyone else with the same problem finds this useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.