locked
Intermittent error occuring on customised edit.aspx pages. RRS feed

  • Question

  • Scenario: I have a list which has customised new.aspx and edit.aspx forms.

    New.aspx has been edited in SharePoint designer. The old webpart for the form was hidden and a new SharePoint list from was added. The new list form had one of the entry fields removed.

    Edit.aspx has also been edited in SharePoint designer in the same way. The old webpart was hidden and a new SharePoint list form was added. This time all of the items except the one which was removed from new.aspx customised list form were removed.

    The purpose of this is that the new list item is posted and an alert is sent to someone to complete the remaining field via the customised edit page.

    So here's the problem: The item posts successfully, the email alert is recieved (containing a link to edit.aspx) and the edit page opens with the remaining field to be completed. When the field completed and the user clicks ok to submit the change the error message "An unexpected error has occurred." is displayed and the item is not updated. When the user goes back to retry the same error message appears. Strangely, if the user reloads the edit.aspx page by clicking the link in the alert again or through clicking edit on the list item itself it then works correctly and updates the item.

    I have created two lists with this type of required functionality and the same happens on both.

    If anyone has any ideas please post.

    Many thanks!



    • Edited by Rob.King Monday, August 8, 2011 8:39 AM further clarity
    Monday, August 8, 2011 8:38 AM

Answers


  • How did you hide the Web Part? by setting the visible flag of the WebPartZone to false? if so, could you try hiding the web part using the div tag as below

     <div style="visibility:hidden">
        <WebPartPages:WebPartZone runat="server" ID="HIDDENZONE">
        <ZoneTemplate>

        </ZoneTemplate>
        </WebPartPages:WebPartZone>
      </div>

     


    --Cheers
    • Marked as answer by Rob.King Tuesday, August 9, 2011 7:49 AM
    Monday, August 8, 2011 3:13 PM

All replies

  • Please look for more information in the logs.

    Also, try to change the entry in web.config, by setting the CallStack value to "true" (<SafeMode MaxControls="200" CallStack="true">)

    Also set the custom errors to 'Off'  <customErrors mode=“Off“/>

    The above setting will give you more information about the error

     


    --Cheers
    Monday, August 8, 2011 8:58 AM
  • Thanks Prasath.

    Ok, so here's the full error message (below) having made those changes to the web.config file. Does this suggest the field being edited is the wrong format? The field is simply a choice field which is a drop down menu so I'm unsure how it can be the wrong format. If it was one of the original fields (now hidden) causing the problem surely it wouldnt have posted initially on the new.aspx form?

    - Edit: Also, It's allowing me to proceed with the change once I've reloaded the form as I previously mentioned.

    Any help would be great.

    Thanks

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Input string was not in a correct format.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.FormatException: Input string was not in a correct format.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

    Stack Trace:
    [FormatException: Input string was not in a correct format.]
       System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +10161091
       System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +207
       System.Convert.ToInt32(String value, IFormatProvider provider) +55
       Microsoft.SharePoint.WebControls.ItemHiddenVersion.OnLoad(EventArgs e) +439
       System.Web.UI.Control.LoadRecursive() +66
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

     

     


    • Edited by Rob.King Monday, August 8, 2011 10:29 AM Further detail (highlighted)
    Monday, August 8, 2011 10:28 AM

  • How did you hide the Web Part? by setting the visible flag of the WebPartZone to false? if so, could you try hiding the web part using the div tag as below

     <div style="visibility:hidden">
        <WebPartPages:WebPartZone runat="server" ID="HIDDENZONE">
        <ZoneTemplate>

        </ZoneTemplate>
        </WebPartPages:WebPartZone>
      </div>

     


    --Cheers
    • Marked as answer by Rob.King Tuesday, August 9, 2011 7:49 AM
    Monday, August 8, 2011 3:13 PM
  • Both web parts were in the same zone, the original web part was hidden by ticking the hidden option in the web part properties.

    I moved the customised web part out of the zone and then applied the div tag you suggested. The customised edit form now appears to work every time.

    Thank you very much for your assistance!

    Tuesday, August 9, 2011 7:48 AM