Properties are making trouble
Posted
by
DhavalR
on Stack Overflow
See other posts from Stack Overflow
or by DhavalR
Published on 2013-11-04T09:47:43Z
Indexed on
2013/11/04
9:53 UTC
Read the original article
Hit count: 249
In my application I have added a Properties.cs file which contains properties that I am would use through out the application. I am getting NullReferenceException => Object reference not set to an instance of an object. Here is the code for Properties.cs
public class Properties
{
private static string type1;
public static string Type1
{
get
{
return type1;
}
set
{
type1= value;
}
}
}
And when I access this property in one of my form I am getting error. e.g.
if (Properties.Type1.Equals(string.Empty) || Properties.Type1.Equals(null))
{
//// Do something
}
© Stack Overflow or respective owner