Hey,
I have this code in an event receiver. The event is listadded
string CTNameHDMDocument = "CTName";
int HDMDocTemplateID = 10100;
if (properties.TemplateId == HDMDocTemplateID)
{
SPSite oSite = new SPSite(properties.WebUrl);
SPWeb oWeb = oSite.OpenWeb();
SPList oList = oWeb.Lists[properties.ListTitle];
SPContentType oDocContentType = oWeb.AvailableContentTypes[CTNameHDMDocument];
SPContentType oFolderContentType = oWeb.AvailableContentTypes[CTNameFolder];
oList.ContentTypesEnabled = true;
oList.ContentTypes.Add(oDocContentType);
oList.ContentTypes.Add(oFolderContentType);
oList.Update();
}
The code works fine, but the user has to press F5 after the list generation.
What I has to change on the code when I want to hang the code an event listadding?
Thanks for your help
Regards
Stefan