0

I want to develop a SPS 2013 page with web parts that fetches List data. but it should show personalized data based on the user credentials. user will be accessing internally.

Wonder how can I achieve this to make it dynamic. please check the site page to understand the requirement.

enter image description here

As per the image, data in WebPart 1 & 3 will be personalized based on the user accessing the page.

Any pointer will be of great benefit.

Jason

4
  • You can get current logged in user and using it you can fire query to get personalized data. May 5, 2016 at 6:10
  • Dikesh, can you please elaborate. I m after: a) How to fire personlized data b) Accessing the relevant page, how it will understand for the data to be pulled is based on the user logged. c) If CQWP then it would fetch the list data , but that wont be personalized, it will pull from a specific list. wherein I need it on dynamic basis.
    – Jason
    May 5, 2016 at 6:31
  • You might be able to do webpart 1 using view (look up filter by [Me]) webpart 3 you will need custom code that does REST calls to get the data (which is what @DikeshGandhi was talking about i assume)
    – Roland
    May 5, 2016 at 6:41
  • Thanks Roland, for Webpart 1 , lookup filter by [Me]?
    – Jason
    May 5, 2016 at 23:14

1 Answer 1

0

According to my understand, (You have fixed lists/libraries)

You can get current logged in user using below code. Using that you can fire CAML/Linq query on specific Lists or libraries in your code to pull all data related to that logged in user.

   SPWeb theSite = SPControl.GetContextWeb(Context);
   SPUser theUser = theSite.CurrentUser;
   string strUserName = theUser.LoginName;

You can get reference from this url for caml query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.