Bug or Feature ;)

Discussion in 'ASP .Net' started by Meelis Lilbok, Mar 30, 2006.

  1. Hi

    Im using ASP.NET 2.0.

    On my page i have two textboxes txtUserName and txtPassword
    and two RequiredFieldValidators' binded to each controls

    Validate works fine only if i leave both textboxes empty or leave
    txtPassword empty.
    But when i enter some text in txtPassword field and let txtUserName empty
    then validate does not work!

    Must it be or is this a bug?

    Meelis Lilbok, Mar 30, 2006
    1. Advertisements

  2. Meelis Lilbok

    Ray Booysen Guest

    Can you post your code?
    Ray Booysen, Mar 30, 2006
    1. Advertisements

  3. Sounds like a bug. Would need to see ur html to help any more than that.
    Karl Seguin [MVP], Mar 30, 2006
  4. Hi again

    Found a problem!

    This happens only then when i set AutoPostBack to True on txtPassword field.

    If i set autopostback to false and click on login button, then validation
    works ok.

    Is it a still bug?

    Meelis Lilbok, Mar 30, 2006
  5. Due to a timing issue with when page validation occurs, you must explicitly call the
    Validate method to ensure that the values on the page are valid, if you use AutoPostBack.


    Otherwise, set AutoPostBack to false,
    and Page.Validate will be called automatically when the page is posted.
    Juan T. Llibre, Mar 30, 2006
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.