Mono Support webpart addition in login.aspx creates problem 

Viewed 13372 time(s), 4 post(s), 6/25/2013 10:10:48 AM - by sonap
6/25/2013 10:10:48 AM
475 Reputation 52 Total posts

Hello, I am trying to add a text editor webpart in my login page coding the page in notepad++.
I added:
<%@ Register TagPrefix="MonoX" TagName="Editor" Src="/MonoX/ModuleGallery/MonoXHtmlEditor.ascx" %> 
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX" TagPrefix="portal" %>
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX.ModuleGallery" TagPrefix="ModuleGallery" %> 
<%@ Register TagPrefix="MonoX" TagName="AdModule" Src="/MonoX/ModuleGallery/AdModule.ascx"  %>

and placed the part:
<div class="span6 clearfix" style="position: relative;">
                    <portal:PortalWebPartZoneTableless ID="topPartZone" runat="server" Width="100%" ChromeTemplateFile="Standard.htm" HeaderText='<%$ Code: PageResources.Zone_TopPartZone %>'>
                    <ZoneTemplate>
                        <MonoX:Editor runat="server" ID="editor12" Title='<%$ Code: PageResources.Title_MiddleSection %>' DefaultDocumentTitle='<%$ Code: PageResources.Title_MiddleSection %>'>
                            <DefaultContent>
                                <div class="notification">                                  
                                    <p>Not a member? Sign-in here</p>                               
                                </div>                                                
                            </DefaultContent>
                        </MonoX:Editor>                        
                    </ZoneTemplate>
                   </portal:PortalWebPartZoneTableless>

                    
                    <div>
                        <MonoX:Membership runat="server" ID="ctlMembershipEditor" />
                    </div>
                </div>

It creates the following error:
You must enable Web Parts by adding a WebPartManager to your page.  The WebPartManager must be placed before any Web Part controls on the page.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.InvalidOperationException: You must enable Web Parts by adding a WebPartManager to your page.  The WebPartManager must be placed before any Web Part controls on the page.

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: 

[InvalidOperationException: You must enable Web Parts by adding a WebPartManager to your page. The WebPartManager must be placed before any Web Part controls on the page.]
System.Web.UI.WebControls.WebParts.WebZone.OnInit(EventArgs e) +196
MonoSoftware.MonoX.TemplatedWebPartZone.OnInit(EventArgs e) +203
MonoSoftware.MonoX.PortalWebPartZone.OnInit(EventArgs e) +68
System.Web.UI.Control.InitRecursive(Control namingContainer) +358
System.Web.UI.Control.InitRecursive(Control namingContainer) +183
System.Web.UI.Control.InitRecursive(Control namingContainer) +183
System.Web.UI.Control.InitRecursive(Control namingContainer) +183
System.Web.UI.Control.InitRecursive(Control namingContainer) +183
System.Web.UI.Control.InitRecursive(Control namingContainer) +183
System.Web.UI.Control.InitRecursive(Control namingContainer) +183
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1505


I think that this is due to the fact that th eimplementation corncerns on the Login page but i cannot fix it :(

1
6/25/2013 10:18:23 AM
15993 Reputation 2214 Total posts

Hi,

please try to add the following code above the "<portal:PortalWebPartZoneTableless ID="topPartZone" runat="server"..."

<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX" TagPrefix="portal" %>
<!-- You already have this -->
....
<portal:PortalWebPartManager ID="wpm" runat="server" CommittingChanges="False" HasUnapprovedChanges="False" OnInit="PortalWebPartManager_Init" >
            <Personalization InitialScope="Shared" />
</portal:PortalWebPartManager>
Regards

2
6/25/2013 11:30:45 AM
475 Reputation 52 Total posts

Thank you very much. Was this because of the login page? 

3
6/25/2013 3:14:13 PM
15993 Reputation 2214 Total posts

No, this was probably because you have changed the master page. MonoX master page that comes with the demo pages has the PortalWebPartManager and then everything works. So best practice is to have PortalWebPartManager on some master page so you don't have to add this to every page.

Regards

4
This is a demo site for MonoX. Please visit Mono Software for more info.