Remove the Readonly from field in sharepoint using custom code.

Sagarp
Posted by Sagarp under Others category on | Points: 40 | Views : 3854
protected void Page_Load(object sender, EventArgs e)

{

try

{

string strSiteUrl = "http://wowdev:99/sites/testing";

using (SPSite oSite = new SPSite(strSiteUrl))

{

using (SPWeb oWeb = oSite.OpenWeb())

{

oWeb.AllowUnsafeUpdates = true;

SPList oList = oWeb.Lists["Tasks"];

SPField oField = oList.Fields.GetFieldByInternalName("Author");

oField.ReadOnlyField = false;

oField.Update(true);

oList.Update();

}

}

}

catch (Exception ex)

{

;

}

}

Comments or Responses

Login to post response