Hi,
I'm getting this error while running following code.
Server Error in '/' Application.
Object reference not set to an instance of an object.
private void CheckFriendshipStatus()
{
var obj1 = Session["UserId"].ToString();
var obj2 = Session["CurrentProfileId"].ToString();
if (obj1 == obj2)
{
btnAddAsFriend.Visible = false;
}
I also tried private void CheckFriendshipStatus() { if (Object.Equals(Session["UserId"].ToString(), Session["CurrentProfileId"].ToString())) { btnAddAsFriend.Visible = false; }
lal p4 reputationPosted Mar 9, 2016, 3:43 AM EST
Tom MohanRank #912 · 2.3K reputationPosted Mar 9, 2016, 4:53 AM EST
Saravanan30 reputationPosted Mar 9, 2016, 4:55 AM EST
Praveenu Veenu5 reputationPosted Mar 10, 2016, 5:36 AM EST