We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to send async messages/notifications to the front-end user in the client session from the server/controller/service

Hello, I have server side changes/alerts that I want to notify/show the user, for e.g. Message is -> request approved.

  • Since the user is in the same page/view in ASP MVC 4.52, how can my server publish-push this message to any view in the client session to his front end browser.
  • please share a working sample (with the latest js, and SyncF libs) on how can we show this to user in his view, and let it fade after 5 seconds.
  • Or user can dismiss by clicking on it
  • Which control is best suited, I was assuming dialog, is this correct?




thanks
Mega

8 Replies

NP Narayanasamy Panneer Selvam Syncfusion Team July 26, 2016 01:32 PM UTC

Hi Megatron, 

Thank you for contacting Syncfusion support. 

We have prepared a sample with Dialog control based on the given details. In the attached sample, you will get Dialog pop up with entered content in text box.  

If this isn’t your requirement, please share us the following details: 
1.       How do you pass the value changes from server? 
2.       What kind of server side changes is intended to be notified in client side? 
3.       Modify the shared sample based on your application scenario and update us with further details on your requirement. 
 
Provide us the details above, so that we can provide you an alternative solution. 
 
 
Regards, 
Narayanasamy p. 



ME Megatron July 26, 2016 08:38 PM UTC

Hi is this signalR, on my hosting site its not working.


ME Megatron July 27, 2016 02:05 AM UTC

Sorry, but its not building for me, i even updated the code to current, this sample has mvc 2, can you update to the current libs, and give me a working sample.

Severity    Code    Description    Project    File    Line    Suppression State Error    CS0619    'SignalRRouteExtensions.MapHubs(RouteCollection)' is obsolete: 'Use IAppBuilder.MapSignalR in an Owin Startup class.  for more details.'    SignalRChat    C:\users\megan\SIGNAL-Notifications\SignalRChat\Global.asax.cs    19    Active

can signalR be active on pasges that are using the traditional POST/GET ASP MVC, can you please explain the mechanism also on how to integrate along with my ASP MVC app.


NP Narayanasamy Panneer Selvam Syncfusion Team July 27, 2016 10:55 AM UTC

  
Hi Megatron,    
   
Thanks for your update.   
   
We can able to build and run the shared sample. We request you to configure “Microsoft ASP.NET SignalR” nugget package in your machine. If you have configured correctly, then the sample will build and works fine.   
    
For more information, please refer the below links to getting started with SignalR nuget package.   
   
References:   
   
http://signalr.net/    
   
Please find the modified project for hosting purpose from the below link: http://www.syncfusion.com/downloads/support/forum/125107/ze/SignalRChat-1384283074    
   
   
   
Regards,   
Narayanasamy P.   



ME Megatron July 27, 2016 06:56 PM UTC

Hi, I suggest you first google this -  CS0619    'SignalRRouteExtensions.MapHubs(RouteCollection)' is obsolete: 'Use IAppBuilder.MapSignalR in an Owin Startup class. - it shows you're using unsupported code in your samples

If you look at your sample - it clearly shows signarlR version 1. Microsoft has deprecated this, and no longer supporting it, its SignarlR V2.

Your sample contains outdated code and libs from MVC 2, so it runs on your machine, trying updating the nuget packages - all Microsoft will show you the link to the code that has been deprecated.


ES Ezhil S Syncfusion Team July 28, 2016 12:35 PM UTC

Hi Megatron, 
 
Thanks for your update. 
 
We have provided you with a simple sample using SignalR concept with our Dialog control to achieve your requested scenario. As you have mentioned the previously updated sample uses SignalR 1.1 and MVC 4 version. If you have configured for SignalR 2.2.1 (current stable verion) from nugets, then please follow the steps in the below link because of deprecated MapHubs. 
 
We have upgraded the sample with SignalR 2.2.1 and its available in the following link: 
 
If this isn’t your requirement, please share us a simple sample based on your application scenario about the server side changes that are intended to be notified in client side and update us with further details it. Also explain the difficulties you are facing with Syncfusion Dialog in your case. So that we can help you out better to use our controls. 
 
Regards, 
Ezhil S 



ME Megatron July 28, 2016 03:41 PM UTC

Hi, even with this version the code seems to have been copied and pasted from over 3 yrs ago, its not working, can you give me a working version with current libs working for vs 2015

I mentioned 3 days ago, "Your sample contains outdated code and libs from MVC 2,"  that its using the old MVC libs, and I asked for the current versions.

it still using the old not supported code - compiler in 4.5.2 and 4.6.1 are both complaining -> SignalRRouteExtensions.MapHubs(RouteCollection)' is obsolete

Severity    Code    Description    Project    File    Line    Suppression State
Error    CS0619    'SignalRRouteExtensions.MapHubs(RouteCollection)' is obsolete: 'Use IAppBuilder.MapSignalR in an Owin Startup class.  for more details.'    SignalRChat    C:\users\megan\SignalRChat-21725252725\SignalRChat\Global.asax.cs    19    Active

I looked at the dependencies and upgraded to the correct jquery version.



ES Ezhil S Syncfusion Team July 29, 2016 03:11 PM UTC

Hi Megatron, 

Thanks for the update. 

We have provided sample in MVC4 and SignalR 2.2.1 version. Please find the below screen shots, 
MVC Version: 
 
SignalR version: 
 
Share us a simple sample based on your application scenario about the server side changes that are intended to be notified in client side and update us with further details it. Also explain the difficulties you are facing with Syncfusion Dialog in your case. So that we can provide you alternative solution. 
 
 
Reference:  
  
Regards, 
Ezhil S 


Loader.
Live Chat Icon For mobile
Up arrow icon