Skip to main content

Posts

Showing posts from December, 2013

Extension methode for web.AllowUnsafeUpdates

How we do it:

using (SPSite site = newSPSite(SPContext.Current.Site.Url)) { using (SPWeb web = site.OpenWeb()) { web.AllowUnsafeUpdates = true; SPList list = web.Lists.TryGetList("TestExtensionList"); SPListItem item = list.Items.Add(); item[SPBuiltInFieldId.Title] = TextBox1.Text.Trim(); item.Update(); web.AllowUnsafeUpdates = false; }
}
How we can do it:


using (SPSite site = newSPSite(SPContext.Current.Site.Url)) { using (SPWeb web = site.OpenWeb()) { web.DoUnsafeUpdate(delegate() { SPList list = web.Lists.TryGetList("TestExtensionList"); SPListItem item = list.Items.Add(); item[SPBuiltInFieldId.Title] = TextBox1.Text.Trim(); item.Update(); }); } }

SharePoint connected Web Part not showing connections option

Possible reasons include the following:
You are not browsing a web part in edit mode. To set connection with other web part, Page should be in edit mode.Web part connection not allowed in the Web Application. To enable web part connection follow below steps: 1)   Open the central administration
2)   Application management
3)   Web applications
4)   Manage web applications
5)   Select the web application for which you would like to enable the option
6)   On the top-Ribbon-You will find an option as ‘webpart security’
7)   Click on it and you will get one frame window which specifies ‘security for web pages
8)   Here you will find the option of Web part connections
9)   Select the option “Allows users to create connections between Web Parts”
1)Open the central administration 2)Application management 3)Web applications 4)Manage web applications 5)Select the web application for which you would like to enable the option 6)On the top-Ribbon-You will find an option as ‘webpart security’ 7)Click on it and y…