HEXAQ : A friendly question - answer site for IT professionals

C#: An unhandled exception of type 'System.StackOverflowException' occurred


0

I have declared public variable in my webform

public string ProductName

        {

            get

            {

                return ProductName;

            }

            set

            {

                ProductName = value;

            }


        }

it throws error at line

            ProductName = value;

The error message I am getting is

An unhandled exception of type 'System.StackOverflowException' occurred in 'myProject.dll'

When I checked inner exception message it shows

{Cannot evaluate expression because the current thread is in a stack overflow state.}

Whats wrong with my code?

Â
asked
 


≡ Total 0 Answer

Enter your reply here
Answer Preview: