ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Server notifications using awem.notif ?
Title:
B
I
{code}
?
I'd like to use awem.notif to notify users of events from the server, by trial and error found that ActionResult ... return JavaScript("Hi"); works. Is there any documentation for what I'd like to accomplish?
Save Changes
Cancel
Stephan Luis
asked at 15 May 2018
Answers
B
I
{code}
?
it has the signature `awem.notif(message, time in milliseconds, popup css class)` if you specify time as zero `0` the popup will not close automatically examples: awem.notif('hi', 2000); awem.notif('error', 0, 'o-err'); to notify about events from the server you need a way to send messages from the server to the client, and the client can call `awem.notif`, depends on the application, one way would be to use signalr, or could be a simple ajax request.
Save Changes
Cancel
Omu
answered at 15 May 2018
aspnetawesome picks up errors, which you explained in that other post ... why/ how does it pick up the 'JavaScript('hi')', controller ActionResult type?
at 15 May 2018
Stephan Luis
I presume that `JavaScript('hi')` throws an error because this function doesn't exist, you might as well write `asdfa('hi')`, when an error occurs in an awesome control code, it will call `awe.err` which is setup in `utils.js` `init` method to call `awem.notif` with the error message
at 15 May 2018
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK