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

Asked

Viewed 51 times

-1

I am doing the registration part of a system, in this registration it is possible to save several comments and edit them as we insert them or later, but it should work as follows, the user inserts the data, on the same screen, he clicks Include comments, (with other words) when including these comments, it should not be stored directly in the bank, as it should be saved in some kind of cache until the registered user finishes inserting all other comments (always clicking on Include comments) and the other data and clicking save.

From now on, thank you.

  • 3

    And what’s the problem/doubt?

  • 3

    Add the code.

2 answers

1


You can record everything in Session by setting an expiration time and an ID for it. At the end, you read Session, record, and clean Session. Or work with cookies, which uselza user processing, not server, following the same way.

We usually use "cookies", to avoid overloading the server if the site has many access.

  • I made through Session, thank you André!

0

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

Sort of like this:

public Actionresult Inclucomentario(Tmodel model, Tcomentario comentario)

{

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

}

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.