Showing posts with label Sharepoint 2010. Show all posts
Showing posts with label Sharepoint 2010. Show all posts

Sunday, 6 July 2014

Get current logged in user


    To get current logged in user for Sharepoint use this piece of code. You can use this code with custom forms where it gets the current logged in user name.


                        SPWeb getcurweb = SPControl.GetContextWeb(Context);
                        SPUser getcurlogeduser = getcurweb.CurrentUser;
                        string currentusername = getcurlogeduser.Name;



Tuesday, 11 March 2014

An unhandled exception occurred in the silverlight application sharepoint 2010



              When i try to create a new list or document library in my site, I came across this weird problem.




              The original problem is Silverlight application in sharepoint does not get connected to the Windows Communication Foundation. This dosent allow us to create a list or library in a site. This is just a security issue at server side  and could be resolved by following this procedure.                    


  1. Open Central Administration
  2. Select Application Management
  3. Select Manage Web Applications
  4. Select the Web Application where the error occurs
  5. In the ribbon, select General Settings
  6. In the Web Application General Settings dialog box, find Web Page Security Validation and select On 

This resolves the problem and now a new list or library could be created.