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 62125 time(s), 20 post(s) 8/1/2014 7:00:34 PMby ZaeVega

Related topics

ZaeVega

ZaeVega

8/1/2014 7:00:34 PM
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!
This content has not been rated yet. 
22 Reputation 2 Total posts
Zoomicon

Zoomicon

8/2/2014 11:07:20 AM

I'd vote for that too ;-)

Rated 3.00, 1 vote(s). 
2793 Reputation 345 Total posts
khorvat

khorvat

8/4/2014 9:56:23 AM
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
Rated 5.00, 1 vote(s). 
15993 Reputation 2214 Total posts
ZaeVega

ZaeVega

8/4/2014 3:54:55 PM
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
This content has not been rated yet. 
22 Reputation 2 Total posts
imarusic

imarusic

8/8/2014 8:05:00 AM
Hi Zaevega,

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

Regards.
This content has not been rated yet. 
3016 Reputation 428 Total posts
imarusic

imarusic

8/8/2014 9:32:15 AM
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.
This content has not been rated yet. 
3016 Reputation 428 Total posts
Zoomicon

Zoomicon

8/19/2014 1:24:19 PM
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?
This content has not been rated yet. 
2793 Reputation 345 Total posts
imarusic

imarusic

8/20/2014 8:00:41 AM
Hi, 

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

MonoSoftware.MonoX.Utilities
This content has not been rated yet. 
3016 Reputation 428 Total posts
Zoomicon

Zoomicon

8/25/2014 9:17:56 AM
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>

This content has not been rated yet. 
2793 Reputation 345 Total posts
imarusic

imarusic

8/25/2014 7:04:41 AM
Yes,

Regards.
This content has not been rated yet. 
3016 Reputation 428 Total posts
1 2