.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Enable to sharepoint User Information List

Posted By:Sagar Pardeshi       Posted Date: September 14, 2013    Points: 40    Category: SharePoint    URL: http://www.dotnetspark.com  

In sharepoint User Information List by default hidden for using following code we enable to show this list
 

protected void EnableUSIList(object sender, EventArgs e)
        {
            try
            {
                string strFields = "";
                //Context.Response.Output.Write("Clicked Me!");
                SPSite Site = SPContext.Current.Site;
                Context.Response.Output.Write(Site + "<br/>");
                using (SPWeb Web = Site.OpenWeb())
                {
                	Web.AllowUnsafeUpdates = true;
                    SPList List = Web.Lists["User Information List"];
                    Context.Response.Output.Write(List.ToString() + "<br/>");
                    List.Hidden = false;
                    List.Update();
                    Web.AllowUnsafeUpdates = false;
                    Context.Response.Output.Write(List.Hidden.ToString() + "<br/>");
              
            }
            }
            catch (Exception ex)
            {
                Context.Response.Output.Write("Errors: " + ex.Message.ToString());
            }
	        
        }



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend