Change default New,Edit and View form in SharePoint error using CSOM

Hi,

I am currently trying to change the default forms of SharePoint list using Visual Webpart but having an error regarding the access:


Here is the code I am using:

Hello @John_Mark_De_Jesus,

Welcome to Plumsail Community!

For the ClientContext, you use Basic authentication. Whereas for SPClientProvider - Default. There should be:

new SPClientProvider(AuthType.Basic, login, password)

@John_Mark_De_Jesus,

Please expand the Exception settings and share the screenshot.

@John_Mark_De_Jesus,

Thank you for the screenshots!

What kind of authentication do you use for this web application? This can be found in the Central Administration -> Application Management -> Manage web applications -> Authentication Providers -> Default (or the selected one):

@John_Mark_De_Jesus,

Thank you for teh screenshot!

In this case, instead of Basic you need to use Default or Windows authentication methods in the code.

Hi Thank you for the response. However may I know how to edit or remove the a photo on this thread?