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

  • Home
  • SEARCH
  • 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 78425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:59:07+00:00 2026-05-10T20:59:07+00:00

How do you create a custom control (not an ASCX control) and, more importantly,

  • 0

How do you create a custom control (not an ASCX control) and, more importantly, use it in your project? I’d prefer not to create a separate project for it or compile it as a DLL

  • 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. 2026-05-10T20:59:08+00:00Added an answer on May 10, 2026 at 8:59 pm

    Server controls should be compiled into a DLL. There should be no reason to be afraid of having an additional assembly in your project, and it helps create good project organization.

    ASP.NET Server controls are actually custom classes in an assembly. They do not have an ‘ascx’ markup file associated to them.

    To use a ASP.NET Server Control, you need to tell ASP.NET where to look for its class.

    First, create a Class Library project and add it to your solution, I’ll call mine ‘CustomControls.dll’.

    Once there, add a simple class to be your webcontrol:

    public class Hello : System.Web.UI.WebControl {     public override Render(HtmlTextWriter writer)     {         writer.Write('Hello World');         base.Render(writer);     } } 

    Build your project, and add it as a reference to your main web project.

    Now, in the ASPX page that you want to use this control, you need to register it, so add this as the first line in the aspx AFTER the Page Directive:

    <%@ Register TagPrefix='Example' Namespace='CustomControls' Assembly = 'CustomControls' %> 

    Now, you should have a control named <Example:Hello> available to you. It might take it a minute to show up in intellisense.

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

Sidebar

Related Questions

I want to create a custom UIProperty Control that is not more than a
I want to create a custom control in C# which I will use multiple
I want to create a WebUserControl (not a custom control) in asp.NET (C#). I
I use RadioButton to Create Custom Control and want to know How do I
I create a custom control inherited from Windows.System.Forms.Controls. This is my code of this
I would like to create a custom control in my Android App. It will
I'm trying to create a custom control by deriving from a ZedGraphControl I need
i want to create the custom menu control in UIWebView, by using - (void)
I am trying to create a custom wpf control, I'm wondering how I can
I am learning PyQt and wonder if one can create custom/owner draw control like

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.