value does not fall within the expected range
Did you have the following situation ? Access to the sharepoint list . Operations in any action , then try to contact list again , but this time , and receive the following message value does not fall within the expected range. What to do? You need to refrash the web and the list! Use this code: /// <summary> /// Refresh a List /// </summary> /// <param name="list"></param> /// <returns></returns> public static SPList RefreshList( SPList list) { return RefreshWeb(list.ParentWeb).Lists[list.ID]; } /// <summary> /// Return the web /// </summary> /// <param name="web"></param> /// <returns></returns> public static SPWeb RefreshWeb( SPWeb web) { web = new SPSite (web.Site.ID).OpenWeb(web.ID); web.AllowUnsafeUpdates = true ; ...