خرید بک لینک

Vote count: 0

I'd like to show the user id of the currently logged in user : I can get their name

// logged in?
            var wrapper = new HttpContextWrapper(HttpContext.Current);
            var ticket = wrapper.GetUmbracoAuthTicket();
            isLoggedIn = 0;
            sessionId = "";
            if (ticket!=null){
                if(ticket.GetRemainingAuthSeconds() > 0){
                    isLoggedIn = 1;
                }
                loggedInUseame = ticket.Name.ToString();
                sessionId = wrapper.Session.SessionID.ToString();
            }else{
                loggedInUseame = "";
            }

but I'd also like to get their user id so I can store extra user into in a separate database and look it up on the page.

I did try

@Umbraco.GetCurrentUmbracoUser().Id

but I think that's from an older version of Umbraco as it crashed Umbraco 7.4

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 16 خرداد 1395 ساعت: 13:59

صفحه بندی