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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:49:12+00:00 2026-06-18T07:49:12+00:00

I have a validation method with 5 validation elements to it, 4 of which

  • 0

I have a validation method with 5 validation elements to it, 4 of which work as intended but 1 does not, question is why not?

The issue I have is with Validating “CompetitionCourse”. I want the IsValid to be true only if the combobox cbCourseRound1 is not blank. At the moment this is validating regardless of this combobox being blank or populated. All other validations are working,

private bool Validate(Competition compSetup)
        {
            string CompetitionName = compSetup._CompetitionName;
            int CompetitionFormat = compSetup._CompetitionFormatId;
            string CompetitionGender = cbGenderOfCompetiton.Text;
            string CompetitionMarker = cbMarker.Text;
            string CompetitionCourse = cbCourseRound1.Text;

            if (!CompetitionName.Equals(string.Empty) && !CompetitionGender.Equals("Mixed") && CompetitionFormat.Equals(1) && !CompetitionCourse.Equals(string.Empty) &&
                ((CompetitionGender.Equals("Female") && CompetitionMarker.Equals("Red")) || (!CompetitionGender.Equals("Female") && !CompetitionMarker.Equals("Red"))))
            {
                IsValid = true;
            }
            else
            {
                IsValid = false;
            }
            return IsValid;
        }
  • 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-18T07:49:13+00:00Added an answer on June 18, 2026 at 7:49 am

    depends on what’s in CompetitionCourse. You’ll have to check that yourself by debugging your code.

    You’d be better off making explicitly sure that CompetitionCourse contains null if the ComboBox text field is blank (because I suspect it contains “”):

    CompetitionCourse = (string.IsNullOrEmpty(cbCourseRound1.Text)) ? null : cbCourseRound1.Text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question Is it posible to have the Validation.Validate() method of the Validation Application Block
I have made a form validation using ajax post method. But i got the
I have written an attribute before, but I I have not written a validation
I have a form validation method that's called on submit. It executes a get
I have a custom validation in the enterprise validation block. The DoValidate method is
I have a form on which I use validation. This form has a section
i have following method of Jquery Validation: jQuery.validator.addMethod(alpha, function(value, element) { return this.optional(element) ||
i have a input filed which i am validating using jquery i am trying
I am facing an issue. I have written code for validating my input fields,
I have a form which contains among others: <form id=new_basic_ad class=new_basic_ad method=post enctype=multipart/form-data action=/basic_ads

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.