I have a problem that I can not resolve in any way. Well, I have a project in Asp.NET MVC as follows: Home Model
public class Objeto
{
public Objeto()
{
}
public Objeto(string nome, double valor, double percentual)
{
Nome = nome;
Valor = valor;
Percentual = percentual;
}
public string Nome{ get; set; }
public double Valor { get; set; }
public double Percentual { get; set; }
}
Controller
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Dados(Objeto teste)
{
return View(dados);
}
}
View Index:
@using (Ajax.BeginForm("Dados", "Home", new AjaxOptions { OnSuccess = "Sucesso()", OnComplete = "unlockPage()", OnBegin = "lockPage()", OnFailure = "ajaxHandleError" }, new { @id = "meuForm" }))
{
@Html.LabelFor(model => model.Nome)
<br />
@Html.TextBoxFor(model => model.Nome)
<br />
<br />
@Html.LabelFor(model => model.Valor)
<br />
@Html.TextBoxFor(model => model.Valor)
<br />
<br />
@Html.LabelFor(model => model.Percentual)
<br />
@Html.TextBoxFor(model => model.Percentual)
<br />
<br />
<input type="submit" value="Enviar" />
}
View Data
<label>Os dados inseridos foram:</label>
@Model.Nome
<br />
@Model.Valor
<br />
@Model.Percentual
<br />
Well, what I need is to display View Dados
within View Index
in popup
or modal
, using Jquery
or Telerik
, but data must come from controller
, previously sent via POST
by page Index
.