User Login Probelm

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/24/2008 12:51:45 AM
Gravatar
Total Posts 7

User Login Probelm

hii joe,

this is priya agian after a long time.  My problem now is with user log in. My site layout has a horizontal login bar common to all pages. I modified one of the selected skin's layout.master page to accomplish it. I did nothing but just adding this code to my layout.master page

<portal:SiteLogin ID="LoginCtrl" runat="server" CssClass="login" >
<LayoutTemplate>
<div id="loginbar">
<strong><mp:SiteLabel id="lblEmail" runat="server" ForControl="UserName" ConfigKey="SignInEmailLabel"></mp:SiteLabel>
<mp:SiteLabel id="lblUserID" runat="server" ForControl="UserName" ConfigKey="ManageUsersLoginNameLabel"></mp:SiteLabel></strong>
<asp:TextBox ID="UserName" runat="server" Columns="35" MaxLength="100" Width="120px" />
<strong><mp:SiteLabel id="lblPassword" runat="server" ForControl="Password" ConfigKey="SignInPasswordLabel"></mp:SiteLabel></strong>
<asp:TextBox ID="Password" runat="server" TextMode="password" />
<asp:Button ID="Login" CommandName="Login" runat="server" Text="Login" />&nbsp;&nbsp;
<asp:HyperLink ID="register" runat="server" Text="Application Form" NavigateUrl="~/Secure/Register.aspx" ForeColor="White" />
<asp:Label ID="FailureText" runat="server" CssClass="txterror" EnableViewState="false" />
</div>
</LayoutTemplate>

</portal:SiteLogin>

When user enters invalid credintials or leaves any filed blank, the login error message which it supposed to give is not prompted instead I'm ending up with the following error.

 

Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 88: protected void SiteLogin_LoginError(object sender, EventArgs e)
Line 89: {
Line 90: int errorCount = (int)ViewState["LoginErrorCount"] + 1;
Line 91: ViewState["LoginErrorCount"] = errorCount;
Line 92:


Source File: E:\Projects\mojoportal\Web\Controls\SiteLogin.cs Line: 90

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
mojoPortal.Web.UI.SiteLogin.SiteLogin_LoginError(Object sender, EventArgs e) in E:\Projects\mojoportal\Web\Controls\SiteLogin.cs:90
System.Web.UI.WebControls.Login.OnLoginError(EventArgs e) +105
System.Web.UI.WebControls.Login.AttemptLogin() +273
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
 

This happens only for the virtual pages(like about-us.aspx) I created for my site, but works fine in the actual physical pages like EventCalendarView.aspx,etc.

What might be the problem. Please help me.

 

Thanks

Priya

10/24/2008 7:42:56 AM
Gravatar
Total Posts 18439

Re: User Login Probelm

Sorry but you can't just add SiteLogin control to a master page and expect it to work, it wasn't designed for that. You will have to figure out how to make it work yourself. I would suggest as a first step that you create a UserControl and put the SiteLogin control in the UserControl and put the UserControl in your master page. I'm not saying that will make it work but thats what I would do if I was trying to get it to work. I might also try using it inside an UpdatePanel inside the UserControl.

The biggest problems I see with trying to have the login on every page is SSL. If you have an SSL certificate mojoPortal is designed to force use of it on the login page, you would probably want to force use of SSL on all pages in the site from site settings if you put the login control on every page. Thats why I think its better to just link to the login page.

Best,

Joe

10/24/2008 8:15:36 AM
Gravatar
Total Posts 7

Re: User Login Probelm

hii joe,

Thank you so much, will try it and see. Hope it works.

I have another problem with login.aspx page. When I click RecoverPassword link, the following error is showing up.

Value cannot be null.
Parameter name: 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.ArgumentNullException: Value cannot be null.
Parameter name: format

Source Error:

Line 116: this.PasswordRecovery1.QuestionFailureText = Resource.PasswordRecoveryQuestionFailureText;
Line 117: this.PasswordRecovery1.UserNameFailureText = Resource.PasswordRecoveryUserNameFailureText;
Line 118: this.PasswordRecovery1.MailDefinition.Subject
Line 119: = string.Format(Resource.PasswordRecoveryEmailSubjectFormatString,
Line 120: siteSettings.SiteName);


Source File: E:\Projects\mojoportal\Web\Secure\RecoverPassword.aspx.cs Line: 118

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: format]
System.String.Format(IFormatProvider provider, String format, Object[] args) +2902399
System.String.Format(String format, Object arg0) +43
mojoPortal.Web.UI.Pages.RecoverPassword.PopulateLabels() in E:\Projects\mojoportal\Web\Secure\RecoverPassword.aspx.cs:118
mojoPortal.Web.UI.Pages.RecoverPassword.Page_Load(Object sender, EventArgs e) in E:\Projects\mojoportal\Web\Secure\RecoverPassword.aspx.cs:62
System.Web.UI.Control.OnLoad(EventArgs e) +99
mojoPortal.Web.mojoBasePage.OnLoad(EventArgs e) in E:\Projects\mojoportal\Web\Components\mojoBasePage.cs:287
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

 

 

 

I did not do any modifications for login.aspx or recoverpassowrd.aspx since I started working on mojo. What might be the problem.

 

Thanks

Priya

10/24/2008 8:18:39 AM
Gravatar
Total Posts 18439

Re: User Login Probelm

Proabably you have set the default culture to something other than en-US and the resource file for your default culture is missing the key for Resource.PasswordRecoveryEmailSubjectFormatString

Hope it helps,

Joe

10/24/2008 9:20:25 AM
Gravatar
Total Posts 7

Re: User Login Probelm

hii joe,

My default culture is been set to en-us itself as you can see here
<globalization
culture="auto:en-US"
uiCulture="auto:en-US"
requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="iso-8859-15" />, however PasswordRecoveryEmailSubjectFormatString key is missing in Resource.resx file. how to add it because whenever I try to add any new key to resource file I'm ending up with error could not load mojoportal.web.csproj.

Thanks

Priya

10/24/2008 9:24:02 AM
Gravatar
Total Posts 18439

Re: User Login Probelm

That key is not missing in my copy of Resource.resx

Joe

10/24/2008 9:30:09 AM
Gravatar
Total Posts 7

Re: User Login Probelm

 

But I'm missing it. as I checked now, neither Resource.resx nor the other resource files have it.

 

10/24/2008 9:43:01 AM
Gravatar
Total Posts 18439

Re: User Login Probelm

Guess you either removed it or else renamed some other file to have the same name. Its in the download and its in svn so maybe you should get a clean copy of the code. Its not a new key, its been there for a very long time.

Joe

You must sign in to post in the forums. This thread is closed to new posts.