none
[SP-2010] EditForm Custom with multi-colonnes list

    Question

  • Hi,

    I have a Visual Studio 2010 SharePoint 2010 project. I add a list definition with its instance.

    I add an application page integrated into ma list definition and named EditForm.aspx.

    When I want to edit one of the item, it's my new form EditForm.aspx which is displayed thanks to the following line in my schema.xml : 

    <Form Type="EditForm" Url="EditForm.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\TestEditForm\EditForm.aspx" WebPartZoneID="Main" />
    

    I have UserControl that i insert in my file EditForm.aspx in the zoneTemplate part : 

    <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
                        <ZoneTemplate>
                            <ucHistorique:Historique ID="UserControlHistorique" title="Historique" runat="server" />
                        </ZoneTemplate>
                    </WebPartPages:WebPartZone>

    It works very well, I have my UserControl displayed, and I can modify the 'Title' Column.

    My problem is the following : If I add a second column in my list definition, and i want to edit one of my items, I have an error message : 

    Error Message

    I don't know why ???

    Could you help me ?

    Thanks !

    Wednesday, February 22, 2012 5:07 PM

Answers

  • I find the solution :)

    In fact, if you look at my code :

    <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
                        <ZoneTemplate>
                            <ucHistorique:Historique ID="UserControlHistorique" title="Historique" runat="server" />
                        </ZoneTemplate>
                    </WebPartPages:WebPartZone>

    I try to put some code in a WebPartZone. It works with only one column, but with two columns it fails.

    I move my userControl above the WebPartZone and it works great :)

    <table cellpadding="0" cellspacing="0" id="onetIDListForm" style="width: 100%">
            <tr>
                <td>
                    <ucHistorique:Historique ID="UserControlHistorique" title="Historique" runat="server" />
                    <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
                        <ZoneTemplate>
                            
                        </ZoneTemplate>
                    </WebPartPages:WebPartZone>
                    <img src="/_layouts/images/blank.gif" width='590' height='1' alt="" />
                </td>
            </tr>
        </table>

    I hope this could help someone else !!

    Thanks for your help and your time :)

    • Marked as answer by Chipou Thursday, February 23, 2012 2:29 PM
    Thursday, February 23, 2012 2:29 PM

All replies

  • set autoeventwireup to false and check it .

    Check this article too

    http://sharepoint.stackexchange.com/questions/22555/the-attribute-autoeventwireup-is-not-allowed-in-this-page


    Regards,
    Milan Chauhan


    Wednesday, February 22, 2012 5:53 PM
  • Thanks for your answer.

    I already try to set the autoeventwireup to false, but I get the same error...

    I see this article before too, but I have behind code in my EditForm.aspx.cs (which set my usercontrols to visible or not), so I can't delete this file...

    If I delete the autoeventwireup attribute, I have an error too, which tells me that my 'WorkflowFormulaire.Layouts.WorkflowFormulaire.EditForm' is not safe.

    Thanks for your help !

    Thursday, February 23, 2012 8:48 AM
  • I find the solution :)

    In fact, if you look at my code :

    <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
                        <ZoneTemplate>
                            <ucHistorique:Historique ID="UserControlHistorique" title="Historique" runat="server" />
                        </ZoneTemplate>
                    </WebPartPages:WebPartZone>

    I try to put some code in a WebPartZone. It works with only one column, but with two columns it fails.

    I move my userControl above the WebPartZone and it works great :)

    <table cellpadding="0" cellspacing="0" id="onetIDListForm" style="width: 100%">
            <tr>
                <td>
                    <ucHistorique:Historique ID="UserControlHistorique" title="Historique" runat="server" />
                    <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
                        <ZoneTemplate>
                            
                        </ZoneTemplate>
                    </WebPartPages:WebPartZone>
                    <img src="/_layouts/images/blank.gif" width='590' height='1' alt="" />
                </td>
            </tr>
        </table>

    I hope this could help someone else !!

    Thanks for your help and your time :)

    • Marked as answer by Chipou Thursday, February 23, 2012 2:29 PM
    Thursday, February 23, 2012 2:29 PM