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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:28:48+00:00 2026-05-27T16:28:48+00:00

I have a problem with my radio buttons. What I’m doing is I create

  • 0

I have a problem with my radio buttons. What I’m doing is I create a customer object and at the same time I want to set one bool property of each radio button in the customer base class. The error message I get is “StackOverflowException Was Unhandeled”. The error is pointing at this “IsClient = value;” in the CustomerType class.

Here is where I create the Customer object (inside CustomerForm.cs)

m_customer = new Customer(radioClient.Checked, radioProspect.Checked, radioCompany.Checked, radioPrivate.Checked);


public class Customer : CustomerType
{
private Contact m_contact;
private string m_id;

public Customer()
{
    m_id = string.Empty;
}

public Customer(bool client, bool prospect, bool company, bool priv)
{
    base.IsClient = client;
    base.IsProspect = prospect;
    base.IsCompany = company;
    base.IsPrivate = priv;
    m_id = string.Empty;
}

public Customer(Contact contactData)
{ m_contact = contactData; }

public Customer(string id, Contact contact)
{
    m_id = id;
    m_contact = contact;
}

public Contact ContactData
{
    get { return m_contact; }
    set {
        if (value != null)
            m_contact = value;  
    }
}

public string Id
{
    get { return m_id; }
    set { m_id = value; }
}

public override string ToString()
{
    return m_contact.ToString();
}
}


public class CustomerType 
{

public bool IsClient
{
    get { return IsClient; }
    set { IsClient = value; }
}

public bool IsCompany
{
    get { return IsCompany; }
    set { IsCompany = value; }
}

public bool IsPrivate
{
    get { return IsPrivate; }
    set { IsPrivate = value; }
}

public bool IsProspect
{
    get { return IsProspect; }
    set { IsProspect = value; }
}

}
  • 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-27T16:28:49+00:00Added an answer on May 27, 2026 at 4:28 pm

    All the properties in your CustomerType are recursive – they blow the stack.

    Take a look at this:

    public bool IsClient
    {
        get { return IsClient; }
        set { IsClient = value; }
    }
    

    When you try to get the value of the IsClient property, you then try to get the value of the IsClient property. Which then tries to get the value of the IsClient property …

    Either implement these as automatically implemented properties:

    public bool IsClient
    {
        get; set;
    }
    

    Or have a proper backing field:

    private bool isClient;
    public bool IsClient
    {
        get { return isClient; }
        set { isClient = value; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery to create custom radio buttons and i have a problem.
I have a problem selecting a checked radio button with jquery. The radio buttons
The problem like this, I have a groupBox which contains two radio buttons, when
I would like to have radio buttons in one radiogroup divided into 2 columns
I have two radio buttons both set as async triggers for an update panel
i have a problem in creating radio buttons dynamically, i have a text box
i have a problem in removing radio buttons using, i have used the (.remove)
i have a problem in grouping a dynamically generated radio buttons into a jQuery
i have a problem in preventing duplicates from being entered, i'm generated radio buttons
I have a problem in revealing the actual results of the radio buttons. I

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.