Custom Required TextBox Control

Posted on 2006-04-03
Last Modified: 2012-06-27
I am wanting to make a custom control that combines the TextBox web control with a required field validator. I remember seeing this tutorial on the web before. Does anyone know a link to the tutorial? If not, I have set the points high if anyone wants to post a few pointers.

Basically I am looking for

<myControl:RequiredTextBox /> This would be all functionality of a textbox combined with the functionality of the requiredfieldvalidator for THIS specific field.

Thanks much,
Question by:clickclickbang
    LVL 12

    Accepted Solution

    LVL 26

    Assisted Solution

    i have done this .. i build a custom web control by inherited from textbox .. it has a boolean property called "Mandatory" which the user can set .. if set to true, then i add a required validator and attach it to this textbox .. i also use a summary validator to show the error as a messagebox .. i also have other properties using which the user can configure the error message etc ..

    LVL 1

    Author Comment

    Thanks for the links and idea...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now