mercredi 1 février 2017

Testing a session variable for null or empty space

What I currently have is this:

if ((string)Session["PlanID"] == null)
{
   string PlanID = Request.QueryString["PlanID"];
   Session["PlanID"] = PlanID;
}

What I need is something like this:

if ((string)Session["PlanID"] == null) or if ((string)Session["PlanID"] == "")
{
   string PlanID = Request.QueryString["PlanID"];
   Session["PlanID"] = PlanID;
}

How would I do that?

Aucun commentaire:

Enregistrer un commentaire