How to learn the base class: RequiredFieldValidator?

Discussion in 'ASP .Net Building Controls' started by Joel Finkel, Oct 6, 2003.

  1. Joel Finkel

    Joel Finkel Guest

    Folks,

    I am trying to extend the RequiredFieldValidator control. What I am trying to accomplish should be mindlessly simple: if the ControlToValidate is valid, output an OkayMessage that is rendered in the Font and Style that has been specified for it in the Property Editor.
    It requires that the Style["visibility"] is always set to "show".

    Research with the debugger shows that, unfortunately, the visibility is set in the control's Render method. Therefore I cannot simply override the method in this manner:

    protected override void Render(HtmlTextWriter output)
    {
    this.Style["visibility"] = "show";
    base.Render(output);
    // visibility has been reset to "hidden"!
    }

    This means that I have to override the RenderContents method...probably. Herein lies my question. How do I discover what method I really need to override. How do I discover how the base class actually works? Without knowing this information, how can I possible extend it?

    Thanks in advance for any suggestions!

    Joel Finkel
    Joel Finkel, Oct 6, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Porky Pig Jr
    Replies:
    3
    Views:
    1,015
    Fuzzyman
    May 12, 2004
  2. Alf P. Steinbach
    Replies:
    6
    Views:
    530
    John Carson
    Sep 3, 2005
  3. CoreyWhite
    Replies:
    1
    Views:
    639
    JohnQ
    Mar 31, 2007
  4. Hicham Mouline
    Replies:
    1
    Views:
    577
    Victor Bazarov
    Apr 20, 2009
  5. Karan Rajput
    Replies:
    2
    Views:
    127
    Abinoam Jr.
    Dec 22, 2010
Loading...

Share This Page