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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:14:09+00:00 2026-05-21T14:14:09+00:00

I am new to ASP .NET web controls, but not ASP .NET in general

  • 0

I am new to ASP .NET web controls, but not ASP .NET in general or C#.

I am wondering how I can limit the allowed content types to a specific class.

I have made a custom web control called TabPanel, and I want it to only be able to contain TabPages.

As an example, the following markup should be illegal, since it contains a checkbox.

<cc1:TabPanel ID="TabPanel1" runat="server">
    <cc1:TabPage runat="server">
        this is a simple test
    </cc1:TabPage>
    <cc1:TabPage runat="server">
        this is another simple test
    </cc1:TabPage>
    <asp:CheckBox runat="server" />
</cc1:TabPanel>

In this case, I wouldn’t want the checkbox to be there. How can I block this from happening?

  • 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-21T14:14:10+00:00Added an answer on May 21, 2026 at 2:14 pm

    I figured it out.

    Had to throw an exception under AddedControl procedure that I overrided from the WebControl if the type of the control being added was not of the type I wanted.

    Now the designer shows a beautiful red error-message on the control itself, preventing me from doing such a foolish thing.

    Awesome!

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

Sidebar

Related Questions

I am new to the asp.net world (but not new to .net) and I
New ASP.NET Web API HttpClient has been giving me some strange results. Here is
I've created a new ASP.NET Web Site in VS2008. I'm attempting to rebuild an
I create a new ASP.NET Web API project. I then use nuget to pull
I'm trying to start a new ASP.NET Web Application Project using Visual Studio 2008.
I'm trying to get the new ASP.NET Web API beta (VS 2010 default Web
I'm trying to use the new ASP.NET Web API to do the following: A
I've got to look at the ORM solution for a new ASP.NET Web App
It's been a while since I've created a new ASP.NET web application. (I've been
I am building a new asp.net MVC3 web application for reporting and I want

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.