I have an event receiver which get fired when and item is create. the event receiver will create a new sub-site based on a site template. here is part of the code which is responsible for creating the subsite:-
SPWeb newSite = spCurrentSite.Webs.Add(curItemID, curItemSiteName, "created automatically after adding a new project item", Convert.ToUInt16(1033), webTemplate, false, false);
newSite.Navigation.UseShared = true;
string masterPage = "Custom.master";
var masterUri = new Uri(rootWeb.Url + "/_catalogs/masterpage/" + masterPage);
newSite.BreakRoleInheritance(true, true);
SPGroup group = newSite.SiteGroups["Project Requestors"];
newSite.RoleAssignments.RemoveById(group.ID);
//newSite.Permissions.Remove();
newSite.MasterUrl = masterUri.AbsolutePath;
newSite.CustomMasterUrl = masterUri.AbsolutePath;
newSite.Update();
newSite.Dispose();
now inside the new subsite there is a list named "Business Risks". and inside the "AllItems" view webpart, i want to assign a JSLINK to the webpart. now using the UI i can simply follow these 4 steps:-
- go to the Allitems view page.
- edit the page.
- edit the webpart.
- then under the WebPart Miscellaneous tab to specify the location of the JSLINK.
so can i do these steps inside the event receiver ?