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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:48:04+00:00 2026-05-13T01:48:04+00:00

In my pre-ASP.NET development environment, there was a near-universal best practice: * NEVER use

  • 0

In my pre-ASP.NET development environment, there was a near-universal best practice:

* NEVER use the native controls!
* Instead, subclass ALL the controls, and ALWAYS use the subclassed version.

Why? Because that gave you a hook… one place to write code and have it applied throughout your application.

For example: Suppose you decide that you want a question mark icon to appear to the right of every TextBox in your webforms app. The icon is rendered, and hovering over it pops up bubble help — iff there is text in the TextBox.ToolTip property.

How would you accomplish that, if you’re using the MS-provided TextBox control?

If you consistently used a subclassed version of TextBox in your application, then you could go to that object, and add the method that renders the icon, stocked with your favorite bubblehelp javascript.

Presto! All of your app’s TextBoxes sprout little question mark icons — or they will, when you set their ToolTip text.

Over time, you can easily adapt and enhance ALL your TextBoxes, because they all have a base class that you can modify. You add a feature where ToolTips are set from a resource file. Next, you add a ShowOnLeft property that presents the icon on the left side of the TextBox. Do you like how the iPhone password control shows the last character you type, obscuring the earlier characters? Override your subclassed TextBox’s default behavior for passwords with a method to implement that behavior.

I have never encountered advocates for this practice, in ASP.NET. Have I just missed it? An article describing two dozen ASP.NET design patterns doesn’t have anything related. The posts about how to subclass server controls describe special-purpose one-offs, like a TextBox that only accepts digits — but none of them recommend the pervasive “ALWAYS use subclassed controls!” policy that I subscribed to in olden days.

Does it make sense, to apply this ancient wisdom, when working in ASP.NET? To always use the subclassed equivalent of the native server controls?

If not — why not? Are there other ways to skin this cat? A technique that provides you with just one place where you can augment ALL your application’s instances of a given control?

I’d love to hear about that. I want my TextBoxQMark control. 🙂

TIA – Hoytster

  • 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-13T01:48:04+00:00Added an answer on May 13, 2026 at 1:48 am

    It’s nice in theory, but how often do you need these subclasses and how hard is it to derive the class and search and replace the necessary variables. I’d guess that the “clutter” caused by all the unused subclasses would unnecessarily “complicate” the project.

    Better to add a user control with a textbox and an image or what-ever-control-combination-you-need-than-to-clutter-up-your-project.

    Do you also do this for your WinForms projects? (I’ve seen it done, rarely, and it doesn’t seem to add the value that it claims.)

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

Sidebar

Related Questions

I believe you can pre compile a asp.net mvc application but there are some
I have a pre-compiled ASP.NET website on staging environment. It's virtual root folder contains
I use svn and asp.net. We have a website and there is an error
Whats the advantage of pre-compiling an ASP.NET project using aspnet_compiler.exe? Also, is there a
Is there any performance benefit to pre-compiling an asp.net web application if it's set
How can I cause a redirect in ASP (pre .NET) to carry the Basic
I've added a pre-build action for an ASP.NET web control (server control) project, that
After pre-compiled a ASP.NET web site, I got many files with the names like
I have finally finished reading Pro ASP.NET MVC 2 Framework Chapter 3: Pre-requisites but
I'm planning a new service for my ASP.NET MVC app and want to use

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.