Preview data before saving in bank

1

I'm doing a news site in ASP.NET MVC 5 and there was a need to see Preview of the news before saving it to the bank.

With a action name Preview I can send the data to it and send it to a View with the page design where the news will really be shown, but I lose the Create screen. p>

How do you open a new tab with the Preview screen and the Create screen still intact?

    
asked by anonymous 12.05.2014 / 21:17

1 answer

3

I would do the following:

  • A% void Preview with the following signature:

    public ActionResult Preview(Noticia noticia) { ... }
    
  • View would have all the attributes hidden :

    @Html.HiddenFor(model => model.Titulo)
    @Html.HiddenFor(model => model.ConteudoNoticia)
    
  • You would also have the properties of the Written Model as prediction:

    <div>@Model.Titulo</div>
    <article>@Model.ConteudoNoticia</article>
    
  • Then just send POST the Template again to another Action . It can be Action same:

    public ActionResult Create(Noticia noticia) { ... }
    
12.05.2014 / 21:58