Hi,
I'm trying to clone page templates in code. How do I achieve that?
I need just a simple example.
Currently I use:
PageTemplateInfo template = PageTemplateInfoProvider.GetPageTemplateInfo("xxx");
var repeaterWebPart = template.GetWebPart("xxWebPart");
repeaterWebPart.SetValue("wherecondition", string.Format("TagID = {0}", row.Field<int>("TagID")));
template.CodeName = "xxx" + "." + row.Field<int>("TagID");
template.DisplayName = "xxx" + " " + tagName;
PageTemplateInfoProvider.SetPageTemplateInfo(template);
But this updates the template, it doesn't insert a new one, and I'm trying to find a method to insert, not update.