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 526075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:44:18+00:00 2026-05-13T08:44:18+00:00

I am feeling like an idiot right now, but I cannot for the life

  • 0

I am feeling like an idiot right now, but I cannot for the life of me figure out why I cannot seem to call user controls from within my asp.net webpage. I’m still learning asp.net but I can’t find any information from searching on google.

I’m trying to load a specific control on the page when the user presses a linkbutton. So I created an empty user control via the right click menu:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>

In other words, I have not touched any part of the created user control. Yet attempting to create this web control and add it to the form seems to not work, as it claims that the WebUserControl class does not exist (I have no other controls in my project):

UserControl blah = new WebUserControls();

produces a “The type or namespace is invalid”. Why can none of my asp.net webform pages get the control into scope?

  • 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-13T08:44:18+00:00Added an answer on May 13, 2026 at 8:44 am

    The new control must be added to the site’s Web.config file.

    <configuration>
      <system.web>
        <pages>
          <controls>
            <add tagPrefix="my"
                 tagName="WebUserControl"
                 src="~/WebUserControl.ascx"/>
          </controls>
        </pages>
      </system.web>
    </configuration>
    

    Use this to place the new control in an .aspx page.

    <my:WebUserControl runat="server" ID="MyWebUserControl" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Feeling pretty brain-dead right now. I can, of course, brute-force this, but I feel
OK, I'm feeling like this should be easy but am obviously missing something fundamental
Coming from a C++ background, Im used to multiple inheritance. I like the feeling
I'm feeling like a bit of a moron, but I can't find how to
My gut feeling is that this is not possible, but what I'd like to
Im feeling crazy and I've decided I would really like to write a User-Defined
Ok - I'm feeling like a frustrated idiot. I want to state that upfront.
Lastly I've been feeling like jQuery is slowly becoming the defacto standard in JS
Gut-feeling: It looks a little bit like two threads both try to initialise disk-based
I'm feeling fairly frustrated, because I feel like this is probably very easy/obvious and

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.