Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

ECMAScript --> get current User fails!!

$
0
0

i want to get the current logged in user:

    var ctx = SP.ClientContext.get_current();
    this.web = ctx.get_web();

    this.currentUser = web.get_currentUser();

    ctx.load(this.currentUser);

    alert(this.currenUser.get_loginName());

 

but the current user is always null ---> what im doing wrong?


Viewing all articles
Browse latest Browse all 11508

Trending Articles