DELETE A VIEW  from sharepoint list Programatically Sharepoint 2013

 try
                {
                    baseUrl = "http://sharepointsite:1224:/sites/mysite";;
                    context = new ClientContext(baseUrl);
                    network = context.Web;
                    List sd = network.Lists.GetByTitle("xyz");
                    Microsoft.SharePoint.Client.View approveRejectView = sd.Views.GetByTitle("view1");
                    approveRejectView.DeleteObject();

                    context.ExecuteQuery();
                   response.write("sucess");
                }
                catch (Exception ex)
                {
                   response.write("fail");
                }

Comments

Popular posts from this blog