MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

webpart addition in login.aspx creates problem  (Mono Support )

Viewed 7404 time(s), 4 post(s) 6/25/2013 10:10:48 AMby sonap
sonap

sonap

6/25/2013 10:10:48 AM
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 :(
This content has not been rated yet. 
475 Reputation 52 Total posts
khorvat

khorvat

6/25/2013 10:18:23 AM
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
This content has not been rated yet. 
15993 Reputation 2214 Total posts
sonap

sonap

6/25/2013 11:30:45 AM
Thank you very much. Was this because of the login page? 
This content has not been rated yet. 
475 Reputation 52 Total posts
khorvat

khorvat

6/25/2013 3:14:13 PM
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
This content has not been rated yet. 
15993 Reputation 2214 Total posts