Answer the question
In order to leave comments, you need to log in
Is there such a thing as events in the context of ASP.NET MVC?
Good afternoon. Can you please tell me if there is an opportunity to work with events in ASP.NET MVC?
For example, there is this class:
namespace WindowsFormsApp1
{
public delegate void GetMessage(string m);
public class EventExample
{
public event GetMessage _msg;
public void Test(string s)
{
if(s == "Event")
_msg?.Invoke("Hello I`m Event:)");
}
}
}
Answer the question
In order to leave comments, you need to log in
You want weird.
A classic web server works only on a kick from the client with a request, giving some kind of response to it.
If you want to push something from the server to the client - you need to look from the WebSockets side (correct, but rather difficult) - see here https://habr.com/post/145077/
Or periodically poll the server via ajax by the client and keep which -something static event cache, checking it on request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question