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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:38:58+00:00 2026-06-11T08:38:58+00:00

i’ve been working on this for some time now but I can’t seem to

  • 0

i’ve been working on this for some time now but I can’t seem to be able to find the answer… Google doesn’t really help me today!

I’m working on an C# website that uses a lot of forms with a lot of validation on it. Big forms which have to be typed by hand, (no problems there though).

The problem that I have is that I always want my ValidationControls to have the Display Property set to dynamic.

I have found a work around but I’m not convinced that this is the best solution.

Currently I have a BaseValidatorControlAdapter that sets the validators display type to “Dynamic” like this:

public class BaseValidatorControlAdapter : ControlAdapter
{
    protected override void Render(System.Web.UI.HtmlTextWriter writer)
    {
        System.Web.UI.WebControls.BaseValidator _control = (System.Web.UI.WebControls.BaseValidator)this.Control;
        _control.Display = System.Web.UI.WebControls.ValidatorDisplay.Dynamic;
        base.Render(writer);
    }
}

This is then triggerd by adding an App_Browser which looks like this

<browsers>
    <browser refID="Default">
        <controlAdapters>
            <adapter controlType="System.Web.UI.WebControls.BaseValidator"
                     adapterType="BaseValidatorControlAdapter" />
        </controlAdapters>
    </browser>
</browsers>

My question for you is. Is it possible for me to set the default value of Display for any validator control. Because my current solution just overrides what there is right now and there is no way of changing that. Therefor when the situation arrises that I do need something else then dynamic in the display option there is no solution for it.

I’m almost convinced that there is a better solution to this.

Any advice is appreciated!

Edit august 2nd 2012:

I finally settled with the solution to override the default asp.net controls and add the following constructor to them

public controlname ()
  : base ()
{
    this.Display = "Dynamic";
}

I added all these controls to a namespace and now I can do

<validator:RequiredField ID="RqrdFld_x" runat="server" Display="Static" />

Essentially overriding the default value in my control definition and overriding the default control Display value of Dynamic in the constructor.

  • 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-06-11T08:39:00+00:00Added an answer on June 11, 2026 at 8:39 am

    This link should be helpful in solving your problem.

    You can use a skin file to set defaults for web controls accross a .NET site.

    I have added a folder called DefaultTheme to my App_Theme folder and added a file to it called Skin.skin, with the following contents:

    <asp:RequiredFieldValidator runat="server" Display="Dynamic" />
    <asp:CompareValidator runat="server" Display="Dynamic" />
    <asp:RegularExpressionValidator runat="server" Display="Dynamic" />
    

    ..allowing me to have a default setting for a number of different validators (or other controls) across my website.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.