What is the correct way to implement TOASTR?

3

I'm working with ASP.NET MVC 4, C #, I need to implement toastr following a manual, implement it on the server side and do it once with a base class. Extend MVC controller to support Toastr messages

But they also recommend implementing it on the client side, which is implemented with javascript and whenever you use it.

What is the correct way to implement this notification library?

    
asked by Pedro Ávila 13.12.2016 в 02:55
source

1 answer

2

You should take a look at the previous article

Create an MVC wrapper for Toastr

It is clear that what you do from the server is a component that generates the dynamic javascript that injects into the view, is not doing anything of the other world, to launch the toast after the post to the server generates javascript from codig .net that injects into the view and reaches the browser

  • If you implement it by generating the server-side message, you will need a submit to the action of the controller to launch the message

  • If you implement it as a client code then you should use ajax
    to invoke the action that returns the info that indicates if you must
    unfold toast or not

> > what is the correct way to implement this notification library?

There is not a correct way, it depends on how you want to implement it, whether with submit of the page or without this

As long as I use it, do not implement anything on the server side, only with a .js and .css and then code the client with javascript, jquery or angular making calls to the server through ajax

    
answered by 13.12.2016 / 03:41
source