5
Answers

Unassigned Local Variable

Is it possible to check the unassigned local variable with if condition??

for eg;

string name;

try
{
name= (string)Session["user"];
}
catch {}

if(name==null)
{
//code we want

}

Answers (5)