0
I programmed my controller as follows:
[HttpPost]
public ActionResult Login(string pUsuario, string pSenha)
{
usuario oUsuario = modelOff.usuarios.Where(p => p.usuario1 == pUsuario && p.senha == pSenha).SingleOrDefault();
if (oUsuario == null)
return View("nao");
else
return View(oUsuario.usuario1);
}
I check if the user exists, if it exists send his name to view, if it does not exist, send nao
.
I want to know how to show this information on view.
My view:
@{
ViewBag.Title = "Login";
}
<h2>Olá Fulano</h2>
How’s your view?
– Maniero
It’s blank, I don’t know how to raise it
– Italo Rodrigo
Actually, it’s just Hello John Doe (where so-and-so would be the username)
– Italo Rodrigo