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

The Archive Base Latest Questions

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

I have created Custom .NET controls, and I’d like to know if it’s possible,

  • 0

I have created Custom .NET controls, and I’d like to know if it’s possible, how to add a custom attribute in the web.config when you add the reference to the control.

Currently it is:

    <controls>
            <add tagPrefix="FOO" src="~/Controls/FooControl.ascx" tagName="Bar" />
    </controls>

But what i’d like to do, is the following

    <controls>
            <add tagPrefix="FOO" src="~/Controls/FooControl.ascx" tagName="Bar" defaultVal="12" />
    </controls>

Briefly, I want to add a custom attribute to a .NET a default ConfigurationElement (controls.add in this case) element

I know I could pass it as an attribute when I create the control or add a key in the appsettings, but I’d like to stay away from that if possible.

Thanks for your help,

  • 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-27T20:58:11+00:00Added an answer on May 27, 2026 at 8:58 pm

    No, this is not possible. The TagPrefixInfo class, which is what the tag element maps to is sealed and does not provide any generic properties for this purpose.

    If you do try to add additional properties, your application will break because asp.net will refuse to process it.

    In addition, even if this was possible, it would be very difficult to see how the definition of the tag would map to the actual control that is placed on the page. I think that would get asp.net all twisted into knots trying to resolve that. This would be similar to trying to add an attribute to a using statement.

    Based on your question, you know what most of the rest of the options open to you are.

    About the only one that you didn’t mention was adding a property to the actual control that is placed on the page using the tag, i.e.

    <FOO:Bar ID="test" runat="server" defaultVal="12"></FOO:Bar>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple Asp.Net custom control which automatically combines all the correct
I have created a custom control using VB.NET in Visual Studio 2008 that gives
I have a somewhat complex custom user control, created in C# .NET, which is
I have created a custom control inheriting from a panel in .NET 3.5 The
I have created a web custom control and used within an aspx page. I
I have created a custom tree view control in .NET to display directories. What
I have a asp.net 2.0 web site with numerous asp:DropDownList controls. The DropDownList control
I have created a custom web control to act as a button with an
I have implemented a set of ASP.NET web custom controls and added these to
I'm using Microsoft Sync framework 1.0 (without ADO.NET services) I have created 2 custom

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.