private
void
CreateListFromTemp(SPWeb web,
string
lstTempName,
string
strTitle,
string
strDescription,SPNavigationNode newNode)
{
web.AllowUnsafeUpdates = true ;
SPListTemplate listTemps = web.Site.RootWeb.Site.GetCustomListTemplates(web.Site.RootWeb)[lstTempName];
Guid listId = web.Lists.Add(strTitle + " " + newNode.Title, strDescription, listTemps);
SPList newList = web.Lists[listId];
newList.OnQuickLaunch = true ;
SPNavigationNode listNode = new SPNavigationNode(newList.Title, newList.DefaultViewUrl, false );
newNode.Children.AddAsFirst(listNode);
web.Update();
web.AllowUnsafeUpdates = false ;
}
{
web.AllowUnsafeUpdates = true ;
SPListTemplate listTemps = web.Site.RootWeb.Site.GetCustomListTemplates(web.Site.RootWeb)[lstTempName];
Guid listId = web.Lists.Add(strTitle + " " + newNode.Title, strDescription, listTemps);
SPList newList = web.Lists[listId];
newList.OnQuickLaunch = true ;
SPNavigationNode listNode = new SPNavigationNode(newList.Title, newList.DefaultViewUrl, false );
newNode.Children.AddAsFirst(listNode);
web.Update();
web.AllowUnsafeUpdates = false ;
}