3
I have in my system a Session that stores an information "S" or "N"
Session["Administrador"] = retorno.ADMINISTRADOR;
In the layout I want to convert it to Boolean
@{
bool administrador = bool.Parse(Session["Administrador"].ToString());
}
3
I have in my system a Session that stores an information "S" or "N"
Session["Administrador"] = retorno.ADMINISTRADOR;
In the layout I want to convert it to Boolean
@{
bool administrador = bool.Parse(Session["Administrador"].ToString());
}
3
Try this way:
@{
bool administrador = Session["Administrador"].ToString() == "S";
}
or
@{
bool administrador = Session["Administrador"].Equals("S");
}
Browser other questions tagged c# asp.net-mvc
You are not signed in. Login or sign up in order to post.