I have a drop down list in a aspx form which uses C#.
If I do not choose anything and pressed submit button, it throws nullreference exception.
But, I use the following code to check it in if condition and still not work.
How can I fix it?
string a = this.location.SelectedItem.Value;
if (string.IsNullOrEmpty(this.location.SelectedItem.Value) || this.location.SelectedItem.Value == null || this.location.SelectedItem.Value =="")