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.

Issues with Mobile pages  (Mono Support )

Viewed 14471 time(s), 7 post(s) 1/12/2012 6:07:29 PMby grant.stone007
grant-stone007

grant.stone007

1/12/2012 6:07:29 PM
I am having some issues with mobile pages.

1. I get an error when I go to the /monox/mobile/passwordrecovery.aspx. see below.

2012-01-12 09:44:03,468 [13] ERROR MonoX [97.96.77.33] - Error
System.NullReferenceException: Object reference not set to an instance of an object.
at MonoSoftware.MonoX.ModuleGallery.PasswordRecovery.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

2. When new user registers using /monox/mobile/register.asp and they fill out form and click Register button. They are next presented with a "Your account has been successfully created" screen. My issue is that this screen seems to dynamically generated and displayed with hard coded JQM theme elements. The page has a data-theme="b" but the Header is class="ui-bar-a" (black) and there is a hard coded navbar. The footer is also themed black instead of blue. The same hard coded theming is on the ActivationEmailRecovery.aspx page as well. It does not appear that these pages are templated correct? Is there anyway I can change these pages?

3. On /monox/mobile/register.asp, it appears the link to the Email-Activation recovery page is hadcoded to /monox/mobile/ActivationEmailRecovery.aspx. I want to change the location of my mobile pages to all reside in /m/. Is there a way to change this link's path?

4. On mobile Login.aspx page, when a user attempts to login who has not yet activated his/her account, a message appears. This message has a hardcoded link to /Membership/ActivationEmailRecovery.aspx. I would expect it to go to the mobile ActivationEmailRecovery.aspx. if a user clicks on the link it does appear that /Membership/ActivationEmailRecovery.aspx senses a mobile device and redirects the user to the DefaultMobileRedirectUrl value from the web.config. Is there a way to change this link's path to /monox/mobile/ActivationEmailRecovery.aspx or better yet my custom folder location of /m/ActivationEmailRecovery.aspx?

This content has not been rated yet. 
647 Reputation 69 Total posts
grant-stone007

grant.stone007

1/12/2012 6:32:48 PM
I have another question regarding mobile. It seems that there are numerous instances of hard coded paths to /monox/mobile/ in the mobile codebehind classes. For example the activation emails message (see below) has the value for {2} set to /MonoX/Mobile/AccountActivation.aspx?... even though I have moved all my mobile pages to /m/ folder.

Dear <i>{0}</i>, this is an account activation e-mail from {1}. Please click on the following link in order to activate your account: <br /><br /> <a href="{2}">{2}</a> <br /><br /><br /> Sincerely, <br /><br /> Your {1} team

My question is whether It is possible for me to change all such paths to /momox/mobile/ to /m/ ? I am beginning to think this is not possible or too much of an effort for me without the source code.

I have made good progress thus far by using some custom URL rewrites, and leaving some dummy pages in the /monox/mobile/ folder that redirected to /m/ folder but I have no workaround for link such as above in activation email. My goal was to have everything /monox/mobile/ changed to /m/.
This content has not been rated yet. 
647 Reputation 69 Total posts
denis

denis

1/13/2012 5:55:18 PM
Hi Grant,
1. this has been confirmed as a bug in the new version. The PasswordRecovery has changed significantly in the desktop version, and these changes were not synced with the mobile version. We will send the changed ascx file to you, it should not require other changes.
2. this is actully the MobileMessage.aspx page that is rendered in such scenarios. Its data-theme is defined in the mobile Default.master, as is for all pages. You can change it there.
3. you can change it by inheriting from MonoSoftware.MonoX.ModuleGallery.Mobile.MembershipEditor and overridng the OnInit method. By default, it looks like this, you can put your own URLs here:

protected override void OnInit(EventArgs e)
{           
    this.ActivationPageUrl = Paths.MonoX.Mobile.AccountActivation_aspx;
    this.ActivationEmailRecoveryPageUrl = Paths.MonoX.Mobile.ActivationEmailRecovery_aspx;
    base.OnInit(e);
}

4. you could change this by inheriting MonoSoftware.MonoX.ModuleGallery.Mobile.LoginModule. Here is the code from its constructor:

public LoginModule()
    : base()
{
    Title = "Login - mobile version";
    this.CatalogIconImageUrl = Paths.App_Themes.All.Common.img.parts.Membership.login_png;
    this.PasswordRecoveryPageUrl = Paths.MonoX.Mobile.PasswordRecovery_aspx;
    this.RegisterPageUrl = Paths.MonoX.Mobile.Register_aspx;
    this.ActivationEmailRecoveryPageUrl = Paths.MonoX.Mobile.ActivationEmailRecovery_aspx;
}



Rated 5.00, 1 vote(s). 
7207 Reputation 956 Total posts
denis

denis

1/13/2012 6:14:53 PM
This is the new code for the mobile PasswordRecovery.ascx module. It will solve your first issue.

<%@ Control
    Language="C#"
    AutoEventWireup="true"
    Inherits="MonoSoftware.MonoX.ModuleGallery.Mobile.PasswordRecovery" Codebehind="PasswordRecovery.ascx.cs" %>
<%@ Import Namespace="MonoSoftware.MonoX.Resources"%>
<%@ Register Src="/MonoX/ModuleGallery/CaptchaModule.ascx" TagPrefix="monox" TagName="CaptchaModule" %>
 
<div id="panRequest" runat="server" class="login membership-module-container input-form">
    <div id="Div1" runat="server">
        <asp:ValidationSummary ID="validationSummary" CssClass="validation-summary" runat="server" />
    </div>
    <div class="password-recovery">
        <h2><%= DefaultResources.PasswordRecovery_Title %></h2>
        <dl>
            <dd>
                <label for="<%= txtUserName.ClientID %>"><%= DefaultResources.PasswordlRecovery_UserName %></label>
                <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="vldRequiredUserName" runat="server" ControlToValidate="txtUserName" Text="!" SetFocusOnError="true" CssClass="validator ValidatorAdapter" Display="Dynamic" />
            </dd>
            <dd>
                <asp:Label ID="labMessage" runat="server"></asp:Label>
            </dd>
        </dl>
         
        <div class="input-form">    
            <div class="button-holder">
                <MonoX:StyledButton ID="btnSend" runat="server" EnableNativeButtonMode="true"></MonoX:StyledButton>           
            </div>
        </div>           
    </div>
</div>   
<div id="panChange" runat="server" class="login membership-module-container input-form">
    <div>
        <asp:ValidationSummary ID="validationSummaryChange" CssClass="validation-summary" runat="server" />
    </div>
    <div class="password-recovery">
        <h2><%= DefaultResources.PasswordRecovery_TitleChange %></h2>
        <dl>
            <dd>
                <label for="<%= txtPassword.ClientID %>">
                    <%= DefaultResources.MembershipEditor_Password %></label>
                <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="vldRequiredPassword" runat="server" ControlToValidate="txtPassword"
                    Text="!" SetFocusOnError="true" CssClass="validator ValidatorAdapter" Display="Dynamic" />
            </dd>
            <dd>
                <label for="<%= txtRepeatPassword.ClientID %>">
                    <%= DefaultResources.MembershipEditor_RepeatPassword %></label>
                <asp:TextBox ID="txtRepeatPassword" runat="server" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="vldRequiredRepeatPassword" runat="server" ControlToValidate="txtRepeatPassword"
                    Text="!" SetFocusOnError="true" CssClass="validator ValidatorAdapter" Display="Dynamic" />
                <asp:CompareValidator ID="vldCompareRepeatPassword" runat="server" ControlToValidate="txtRepeatPassword"
                    Text="!" SetFocusOnError="true" ControlToCompare="txtPassword" Operator="Equal"
                    CssClass="validator ValidatorAdapter" Display="Dynamic"></asp:CompareValidator>
            </dd>
            <dd>
                <asp:Label ID="labMessageChange" runat="server"></asp:Label>
            </dd>
        </dl>       
        <div class="input-form">           
            <div class="button-holder">
                <MonoX:StyledButton ID="btnChange" runat="server" EnableNativeButtonMode="true"></MonoX:StyledButton>           
            </div>
        </div>           
    </div>
</div>


Rated 5.00, 1 vote(s). 
7207 Reputation 956 Total posts
grant-stone007

grant.stone007

1/14/2012 12:16:06 AM
The corrected PasswordRecovery.aspx works.

The code you shared provided what was needed to create desired paths. This also was the root of my issue #2 above, It was using the /monox/mobile/mobilemessage.aspx as opposed to my customized /m/mobilemessage.aspx.

Once again, I must give you a huge Thank You for the great support.
This content has not been rated yet. 
647 Reputation 69 Total posts
grant-stone007

grant.stone007

1/14/2012 2:37:23 AM
I wanted to post for the benefit of others that I had to defer that setting of these values for MembershipEditor to the OnLoad() event as opposed to the OnInit() event. See below.

   protected override void OnLoad(EventArgs e)
    {
        this.ActivationPageUrl = "/m/AccountActivation.aspx";
        this.ActivationEmailRecoveryPageUrl = "/m/ActivationEmailRecovery.aspx";
        base.OnLoad(e);
    }
}

This content has not been rated yet. 
647 Reputation 69 Total posts
khorvat

khorvat

1/14/2012 7:05:35 AM
Hi,

thanks for an update, yes you should put the setting in the OnLoad event placing it after the On.Init should work as Denis has provided you with MonoX code sample and MonoX has to perform these kind of initialization very early so you guys can change it later.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts