Skip to main content
Also you can write a function to check the view exist or not
Source Link

You can use "ServerObjectIsNull" property to check if the server object is null

Ex:

if(!view.ServerObjectIsNull.HasValue)

Try using below function to validate the list view.

public bool IsViewExist(string siteUrl, string listTitle, string viewTitle)
    {
        bool isViewExist = false;
        ClientContext context = new ClientContext(siteUrl);

        List list = context.Web.Lists.GetByTitle(listTitle);
        context.Load(list);
        context.ExecuteQuery();

        Microsoft.SharePoint.Client.ViewCollection viewColl = list.Views;
        context.Load(viewColl,
            views => views.Include(
                view => view.Title));
        context.ExecuteQuery();
        foreach (Microsoft.SharePoint.Client.View view in viewColl)
        {
           if(view.Title.Equals(viewTitle))
           {
               isViewExist = true;
               break;
           }

        }

        return isViewExist;
    }

You can use "ServerObjectIsNull" property to check if the server object is null

Ex:

if(!view.ServerObjectIsNull.HasValue)

You can use "ServerObjectIsNull" property to check if the server object is null

Ex:

if(!view.ServerObjectIsNull.HasValue)

Try using below function to validate the list view.

public bool IsViewExist(string siteUrl, string listTitle, string viewTitle)
    {
        bool isViewExist = false;
        ClientContext context = new ClientContext(siteUrl);

        List list = context.Web.Lists.GetByTitle(listTitle);
        context.Load(list);
        context.ExecuteQuery();

        Microsoft.SharePoint.Client.ViewCollection viewColl = list.Views;
        context.Load(viewColl,
            views => views.Include(
                view => view.Title));
        context.ExecuteQuery();
        foreach (Microsoft.SharePoint.Client.View view in viewColl)
        {
           if(view.Title.Equals(viewTitle))
           {
               isViewExist = true;
               break;
           }

        }

        return isViewExist;
    }
Source Link

You can use "ServerObjectIsNull" property to check if the server object is null

Ex:

if(!view.ServerObjectIsNull.HasValue)