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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:50:17+00:00 2026-06-04T21:50:17+00:00

I create a user control with an event like this : public partial class

  • 0

I create a user control with an event like this :

public partial class Person : System.Web.UI.UserControl
{
    public delegate void EditPersonHandler(object sender, EditPersonEventArgs e);
    public event EditPersonHandler EditPerson;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}

and this is my EditPersonEventArgs :

 public  class EditPersonEventArgs:EventArgs
{
    private int id;

    public int ID
    {
        get { return id; }
        set { id = value; }
    }
    public EditPersonEventArgs(int ID)
    {
        id = ID;
    }

}

And now i want to add this User control to my page and i do this :

<%@ Register TagPrefix="UControl" TagName="UControlPerson" Src="~/SimpleUC/Person.ascx" %>

<div>
    <UControl:UControlPerson ID="UControlPerson" runat="server"
                             OnEditPerson="UControlPerson_EditPerson" />
</div>

and this my Function to handle the OnSavePerson :

protected void UControlPerson_EditPerson(object sender, EditPersonEventArgs e)
    {

    }

I built the solution.
but when I render the page i get this error:

Description: An error occurred during the compilation of a resource required to service this
request. Please review the following specific error details and modify your source code 
appropriately. 


Compiler Error Message: CS0426: The type name 'SimpleUC' does not exist in the type 
'System.Web.UI.UserControl'

this is my name space:
namespace UserControl.SimpleUC

  • 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-06-04T21:50:20+00:00Added an answer on June 4, 2026 at 9:50 pm

    You have a namespace conflict, the UserControl part of your user control namespace UserControl.SimpleUC is being resolved as the name space System.Web.UI.UserControl.

    The easiest way to resolve this issue would be to choose another namespace for your control. Possibly something similar like UserControls.SimpleUC

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

Sidebar

Related Questions

I like to create a UserControl with own Header Property. public partial class SomeClass:
I am trying to create a datapager usercontrol. This user control has one event
I'm trying to create User Control which will work like a rich button. It's
How can I create a user control like the Textbox? For example when I
I need to create a Drop Down List in a Web User Control (.NET
I have a usercontrol that is inside another user control, what I would like
I need to create a user control, that will be used in an application
Im trying to create a user control menu where links to a page's usercontrols
I'm trying to create a user control in WPF to represent a Go board
I'm been wanting to create a user control, but before I do I need

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.