What should you do?

You create a Web Part that takes three values from three text boxes and creates a new SharePoint site when you click a button named CreateNewSite.
The Web Part contains the following code segment.
protected void CreateNewSite_Click(object sender, EventArgs e)

You test the Web Part and it works properly.
When another user attempts to use the Web Part to create a new site, he receives the following error message: "Error: Access Denied."
You need to ensure that users can use the Web Part to create new sites.
What should you do?
A. Add web.Update() after the code segment.
B. Add web.ValidatesFormDigest() after the code segment.
C. Run the code segment inside a SPSecurity.RunWithElevatedPrivileges delegate.
D. Add the following code after the code segment:

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.