I have these two actions:
public ActionResult Lista(int PessoaId, string Nome, string Twitter)
{
Pessoa p = new Pessoa();
p.PessoaId = PessoaId;
p.Nome = Nome;
p.Twitter = Twitter;
return View(p);
}
public ActionResult Lista2(FormCollection form)
{
Pessoa p = new Pessoa();
p.PessoaId = Convert.ToInt32(form["PessoaId"]);
p.Nome = form["Nome"]; ;
p.Twitter = form["Twitter"]; ;
return View(p);
}
I have this View:
@model Hello.Models.Pessoa
@{
ViewBag.Title = "Lista";
}
<h2>Lista</h2>
<div>
<b>PessoaId</b>
</div>
<div>
@Model.PessoaId
</div>
<div>
<b>Nome</b>
</div>
<div>
@Model.Nome
</div>
<div>
<b>Twitter</b>
</div>
<div>
@Model.Twitter
</div>
Can not I add two actions to the same View? I tried adding the same View that I added in the first action in the second action, but it was not allowed.