In this tutorial I'm going to illustrate how we can pass complex javascript objects to MVC controller. Here are the Model objects. public class Project { public long ProjectID { get; set; } public string ProjectName { get; set; } } public class Employee { public string Code { get; set; } public string Name { get; set; } } ...
Sometimes we need to add Authorization Tokens in Header in HttpClient. This is sample code for adding Authorization .var client = new HttpClient();client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
We can easily configure StyleCop with MSBuild to make warnings appear as errors with the help of StyleCop.MSBuild NuGet package.First go to Package Manager Console and install it with following command. Install-Package StyleCop.MSBuildThen unload your project and open the project file to modify it.Now you have to add "StyleCopTreatErrorsAsWarnings" property inside "PropertyGroup" tag as below.<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"><PropertyGroup> <ErrorT
In one of my previous article I discussed how we can retrieve data in a SharePoint List Using its Web Services. In this post I’m going to discuss how we can update a SharePoint list using Web Services. Please refer my previous article on "SharePoint List Web Service GetListItems" to learn how to add Web References to your project. Then ...
In this post I’m going to discuss about an easiest way to find GUID of a SharePoint list and a View. If you are using the MOSS 2007 there is straight forward way to get the List GUID, these are the steps.1. Access the list via your browser.2. Go to Settings --> List Settings and right-click on the "Information management ...
In this post I’m going to describe how you can programmatically add a view to SharePoint list or Document Library. You can get this work done by using SPViewCollection.Add Method (Microsoft.SharePoint), here is a sample code, public void createListView() { SPSite site = new SPSite("http://merdev-moss:5050/testsara"); SPWeb web = site.OpenWeb(); SPList list = web.Lists["Tasks"]; SPViewCollection allviews = list.Views; string viewName = ...
In this post I'm going to discuss how you can add a permission level (Read, Contribute, Full Control, etc) to a SharePoint user group. Here is a sample code, public void addPermissionToGroup() { SPSite site = new SPSite("http://mysite:5050/"); SPWeb spWeb = site.OpenWeb(); string permissionName = "Read"; string groupName = "Project Manager"; try { spWeb.AllowUnsafeUpdates = true; SPRoleAssignment roleAssignment = new ...
In this post I’m going to describe how you can remove an Event Receivers from SharePoint List programmatically. This will be very useful if you have deployed and active custom features, because if you create a custom feature for a custom list, that feature will be added to all the custom lists. Then if you want to create list dynamically ...
In my article on "SharePoint Web Part Development Tutorial" I discussed how we can develop and deploy custom SharePoint web part with visual designing. Now let’s see how we can add a chart for that web part. Finally you will be getting a result like following picture.To create the above chart I’m getting data from a SharePoint ...
In my previous article on "SharePoint Workflow Actions for Designer in Visual Studio" I discussed how to create and deploy a custom workflow action to use in the SharePoint designer.In this article I’m going to discussed how you can use the added action in the SharePoint Designer.First open your site in the SharePoint Designer and create new workflow as shown ...
Your article title plays major role to driving long term search engine traffic. For the Title you have to give the overall idea of your article in simple phrase. The most important thing in article is making sure the title contains a strong keyword phrase. Here I’m going to show you very simple way to select a best title for ...