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 )

67737 put(a) pogledan, 20 odgovor(a) 1.8.2014. 19:00:34Kreirao(la) ZaeVega

Povezane teme

ZaeVega

ZaeVega

1.8.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!
Ovaj sadržaj još nije ocijenjen. 
22 Reputacija 2 Ukupno objava
Zoomicon

Zoomicon

2.8.2014. 11:07:20

I'd vote for that too ;-)

Ocjena 3,00, 1 glas(ova). 
2793 Reputacija 345 Ukupno objava
khorvat

khorvat

4.8.2014. 9: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
Ocjena 5,00, 1 glas(ova). 
15993 Reputacija 2214 Ukupno objava
ZaeVega

ZaeVega

4.8.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
Ovaj sadržaj još nije ocijenjen. 
22 Reputacija 2 Ukupno objava
imarusic

imarusic

8.8.2014. 8:05:00
Hi Zaevega,

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

Regards.
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava
imarusic

imarusic

8.8.2014. 9: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.
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava
Zoomicon

Zoomicon

19.8.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?
Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
imarusic

imarusic

20.8.2014. 8: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
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava
Zoomicon

Zoomicon

25.8.2014. 9: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>

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
imarusic

imarusic

25.8.2014. 7:04:41
Yes,

Regards.
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava
1 2