Hi,
I have this code done for sharepoint 2010 which creates a list and adds it to the home page for site. But this does not working with sharepoint 2013. this list is being treated as app. How can i add the app to the home by code.
// Add The List as a Links List Guid listguid = web.Lists.Add(title, descr, template); // Get The List Reference SPList linksList = web.Lists[listguid]; linksList.EnableVersioning = true; linksList.Update(); // Create The Web Part using (ListViewWebPart listViewWebPart = new ListViewWebPart()) { listViewWebPart.ZoneID = "Left"; listViewWebPart.ListName = linksList.ID.ToString("B").ToUpperInvariant(); listViewWebPart.ViewGuid = linksList.DefaultView.ID.ToString("B").ToUpperInvariant(); // Get The Reference To The Default Page For Adding the List To The Entry Screen SPLimitedWebPartManager splimitedWebPartManager = web.GetLimitedWebPartManager( DefaultPage, System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared); splimitedWebPartManager.AddWebPart(listViewWebPart, "Left", splimitedWebPartManager.WebParts.Count); web.Update(); splimitedWebPartManager.Dispose(); } result = linksList;
Thanks