How to get the latest version of at page?

Vote:
 
I need to know how I can get the latest version of a page, it doesnt mather if the latest version is published or not. I just need the absolute latest version.. this is my code today: EPiServer.Global.EPDataFactory.GetPage( new PageReference(id), new LanguageSelector(lang), EPiServer.Security.AccessControlList.NoAccess ); I think I should use one of the overloaded constructors for the the pagereference-object, but I dont understand how they work.
#12744
Mar 25, 2008 18:35
Vote:
 
Have you looked at the static DataAbstraction.PageVersion.List(...)?
#14819
Mar 25, 2008 18:45
Vote:
 
It works fine with the PageVersionCollection: public string GetLatestPageVersionID(string _id, string _lang) { PageVersionCollection pvc = PageVersion.List(new PageReference(_id)); PageVersionCollection pvcLang = new PageVersionCollection(); foreach(PageVersion pv in pvc) { if(pv.LanguageBranch == _lang) pvcLang.Add(pv); } return pvcLang[pvcLang.Count -1].ID.ToString(); } This exampel works with multilanguage.
#14820
Mar 25, 2008 18:45
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.