Need to assign current logged in USER name to the people picker control in ASPX page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jagsusa
    New Member
    • Dec 2009
    • 4

    Need to assign current logged in USER name to the people picker control in ASPX page

    Hi All

    I need to assign the current user to the people picker control in my custom ASPX page which I am planing to host in sharepoint (WSS) .

    I was trying on these lines but without success.


    System.Collecti ons.ArrayList entityArrayList = new System.Collecti ons.ArrayList() ;
    PickerEntity entity = new PickerEntity();
    userPicker = new PeopleEditor();
    userPicker.Mult iSelect = false;
    entity.Key = SPContext.Curre nt.Web.CurrentU ser.LoginName;

    entity= userPicker.Vali dateEntity(enti ty);


    entityArrayList .Add(entity.Key );
    userPicker.Upda teEntities(enti tyArrayList);

    It is throwing type casting exception.did tried with all the rules of the book but nothing worked!

    Please let me know if you have any idea to fix this issue .


    Thanks in advance
Working...