Hi i have a custom webpart that allow users to dynamically add or remove form control using the asp:Repeater. on the same site i have use a similar code and no error was encountered.
when i duplicate the code into the edit form whereby user is able to edit what they previously type, i have encountered the following:
System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.WebControls.DeltaPage.LoadPageStateFromPersistenceMedium()
i understand some1 online suggest installing the Sharepoint 2013 Sept 2014 CU might solved this issue. but after installing the CU, my error still isn't fixed.
need some help on this
i have check my SPWeb UI version using following code
SPWeb web = SPContext.Current.Web;
string version = "";
switch (web.UIVersion)
{
case 3:
// 2007
version = "2007";
break;
case 4:
// 2010 & 2013 "14 mode"
version = "2010 2013 14 mode";
break;
case 15:
// 2013
version = "2013";
break;
}
txtDescription.Text = version;and it is running 2013.
HI i have tried to isolate the difference between the 2 set of code. i found that the error only happen when the url has query parameters, which only happen on editing.
for example if using the same piece of code for the custom web part.
if the url is http://mysite.com/page/edit.aspx <= this will not cause the NUllReference
but if the url is http://mysite.com/page/edit.aspx?id=1 <= this will cause NullReference