0


I am working on a Public Facing web site(Publishing Portal) using Sharepoint 2016. My requirement is to create a custom form which looks like below.

enter image description here

My Question is.
1) How to create a Custom Form for Publishing Portal in Sharepoint which is able to post data.
2) Will I be able to post data to Sharepoint List as a site user? If so How to achieve it?
3) How can I protect that particular list so that nobody is able to read data from it using a rest api.

Looking forward to your replies please.

1 Answer 1

0

Create farm solution with custom webpart(custom form you shared), demo.

Use SPSecurity.RunWithElevatedPrivileges in your webpart to maintain list data.

http://mekishordas.blogspot.com/2013/03/runwithelevatedprivileges-in-sharepoint.html

SPSecurity.RunWithElevatedPrivileges(delegate()  
    {  
        using (SPSite site = new SPSite(siteID))  
        {  
            using (SPWeb web = site.OpenWeb(webID))  
            {  
                // Code Using the SPWeb Object goes here  
            }  
        }  
    });

Set list permission to owner only(break list permission), others can't read it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.