TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gaurav Raj
NA
475
88.7k
How can i create notification code using with SignalR .....
Oct 17 2018 6:08 AM
i need help ....i am create notification code with using javascript which are given below... i dont know its right way or not..... but
How can i create notification code using with SignalR .....Please Help ME guys
setInterval(function () {
getNotificationCount();
}, 3000);
function getNotificationCount() {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "SocialNetWebService.asmx/NotificationCount",
data: '{UserId:' +<%=user %> +'}',
dataType: "json",
success: function (data) {
var d = data.d;
if (d != "") {
var span = document.getElementById('noti_Counter');
span.style.display = "block";
$("#noti_Counter").text(d);
}
},
error: function (result) {
alert("sorry does");
}
});
this is my webmethod
public int NotificationCount(int UserId)
{
Connection cs = new Connection();
var q = from a in cs.da.NotificationCountProcedure(UserId)
select a;
return q.ToList().Count();
}
this is my part of html page
<button id="noti_Button" class="btn btn-link" onclick="getNotification();">
Notification
<span id="noti_Counter" class="badge" style="display:none"></span>
<!--SHOW NOTIFICATIONS COUNT.-->
<!--THE NOTIFICAIONS DROPDOWN BOX.-->
</button>
Reply
Answers (
3
)
log4net programmatic configuation
Active button should be changed into inactive button on clik