tags:

views:

16

answers:

0

I have a user profile property. user not assigned any value that property. If I use below code. It is thorwing exception " object reference not set to an instance of an object "

userprof["OptOut"].ToString()

I tried all types like

if (userprof["OptOut"] != null)
          OR
if(userprof["OptOut"].Value != null)

nothing worked out for me.

Here userProf object has value. userprof["OptOut"].Value is null

How to handle this?