Insert N comments, having the option to edit them at any time and then save those comments [closed]

-1

I am doing the registration part of a system, in this register it is possible to save several comments and edit them as we enter them or later, however it should work as follows, the user inserts the data, on the same screen , it clicks Include comments, (reinforcing with other words) when including these comments, it should not be stored directly in the database, since it must be saved in some type of cache until the user completes inserting all the other comments ( always clicking Include comments) and the other data and clicking Save.

Thank you in advance.

    
asked by anonymous 16.11.2015 / 12:52

2 answers

1

You can record everything in session, determining an expiration time and an ID for it. At the end, you read the session, record, and clear the session. Or work with cookies, which uses the processing of the user, not the server, following the same way.

We usually use "cookies", not to overload the server if the site has lots of hits.

    
16.11.2015 / 13:08
0

You can try to give a post on the page, but instead of saving, you return to the View the same model you receive from the page, just including the comment in a list before returning.

More or less like this:

  

public ActionResult IncludeComment (TModel model, TCommentary comment)

     

{

   //Seu código
 model.Comentarios.Add(comentario);
 return View(model);
     

}

You can also try to save the comment in the Web Sql browser until you no longer need this cached data!

    
16.11.2015 / 13:17