MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

HOW TO DISPLAY NOTIFICATIONS WHEN USER HAS UNREAD MESSAGES  (Mono Support )

Viewed 70657 time(s), 20 post(s) 01.08.2014 19:00:34by ZaeVega

Related topics

ZaeVega

ZaeVega

01.08.2014 19:00:34
Hello everyone, I´m building a social plattform and my client wants to have visually displayed notifications when the users have unread messages, like facebook style, How can this be accomplished? 

Regards!
Dieser Inhalt wurde noch nicht bewertet. 
22 Reputation 2 Total posts
Zoomicon

Zoomicon

02.08.2014 11:07:20

I'd vote for that too ;-)

Bewertet mit 3,00, 1 Besucher. 
2793 Reputation 345 Total posts
khorvat

khorvat

04.08.2014 09:56:23
Hi,

we can provide you with few lines of code to get the counts and then you can display message counts on some control or page. Let us know if this is an option for you ?

BTW - we are working on new notification mechanism (Facebook like) that will have the counts displayed somewhere in the page, I hope this will be done for the v5.x release.

Regards
Bewertet mit 5,00, 1 Besucher. 
15993 Reputation 2214 Total posts
ZaeVega

ZaeVega

04.08.2014 15:54:55
Hi Khorvat,
 I will really appreciate if you can provide me the code you talk about, certainly that could be an option for me.
Thanks and regards
Dieser Inhalt wurde noch nicht bewertet. 
22 Reputation 2 Total posts
imarusic

imarusic

08.08.2014 08:05:00
Hi Zaevega,

sorry for a delay, some one from our support team will get back to you today with code samples.

Regards.
Dieser Inhalt wurde noch nicht bewertet. 
3016 Reputation 428 Total posts
imarusic

imarusic

08.08.2014 09:32:15
Hi,

you can add this code to your markup:

<asp:PlaceHolder runat="server" ID="plhNumber">
         <span class='number'><%= this.NumberOfUnreadMessages%></span>
</asp:PlaceHolder>
and create a property in your code behind:

/// <summary>
/// Gets Number of unread messages.
/// </summary>
public  string NumberOfUnreadMessages
{
    get
    {
            return MonoSoftware.MonoX.Repositories.MessageRepository.GetInstance().GetNumberOfUnreadMessages(SecurityUtility.GetUserId());
    }
}
Also, you will need to add some styling to your markup in order to style your count icon. Below is an example of css snippet:

.login-status-register .message-box .active-message .number {
    background-color: Red;
    font-size: 10px;
    font-weight: bold;
    height: 12px;
    line-height: 12px;
    margin: 0;
    padding: 0;
    position: absolute;
    right: 2px;
    text-align: center;
    top: 2px;
    vertical-align: middle;
    width: auto;
}
Regards.
Dieser Inhalt wurde noch nicht bewertet. 
3016 Reputation 428 Total posts
Zoomicon

Zoomicon

19.08.2014 13:24:19
can you post a screenshot of how this looks on the UI?



also, instead of touching the codebehind, couldn't one do the following?
<asp:PlaceHolder runat="server" ID="plhNumber">
         <span class='number'><%= MonoSoftware.MonoX.Repositories.MessageRepository.GetInstance().GetNumberOfUnreadMessages(SecurityUtility.GetUserId()); %></span>
</asp:PlaceHolder>
in that case, what's the namespace where SecurityUtility class is?
Dieser Inhalt wurde noch nicht bewertet. 
2793 Reputation 345 Total posts
imarusic

imarusic

20.08.2014 08:00:41
Hi, 

yes, you can do it in markup without need to change the code behind. SecurityUtility is in the following namespace:

MonoSoftware.MonoX.Utilities
Dieser Inhalt wurde noch nicht bewertet. 
3016 Reputation 428 Total posts
Zoomicon

Zoomicon

25.08.2014 09:17:56
thanks, so it should be:



<asp:PlaceHolder runat="server" ID="plhNumber">
<span class='number'><%= MonoSoftware.MonoX.Repositories.MessageRepository.GetInstance().
GetNumberOfUnreadMessages(MonoSoftware.MonoX.Utilities.SecurityUtility.GetUserId()); %></
span>
</asp:PlaceHolder>

Dieser Inhalt wurde noch nicht bewertet. 
2793 Reputation 345 Total posts
imarusic

imarusic

25.08.2014 07:04:41
Yes,

Regards.
Dieser Inhalt wurde noch nicht bewertet. 
3016 Reputation 428 Total posts
1 2