Error Message-LogOn-Orchard CMS

Topics: Customizing Orchard, Troubleshooting
Nov 4, 2012 at 12:46 AM

Parser Error-Orchard CMS-LogOn

description

Hello. I am having an issue that has been brought up, but the issue was "fixed". I realize it was fixed but when I tried the suggested solution, it did not work for me. This is my first post on the issue tracker, so please be patient. I am working on a site in WebMatrix locally which I hope to deploy once I get it working correctly. It is actually a site imported from another, including the theme. I'm trying to rebuild it locally so that I can work on it through WebMatrix.

The problem...I successfully have it working, but when I try to login I get an error in every browser.
Excuse me because I am going to drop a lot of code on you. Here's the error, then the code from LogOn.cshtml:
=================================================================
Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: The code block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup.

Source Error: 

Line 1: @using Orchard.ContentManagement;
Line 2: @{
Line 3: var userCanRegister = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
Line 4: var enableLostPassword = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;

Source File: /Themes/ANBLTheme/Views/LogOn.cshtml Line: 2 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
--------------------------------------------------------------------------------------------------------------------

Now the file:

@using Orchard.ContentManagement;
@{
var userCanRegister = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
var enableLostPassword = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;
}
<h1 class="page-title">@Html.TitleForPage((string)Model.Title)</h1>
<p>
@T("Please enter your username and password.")
@if (userCanRegister)
{ @Html.ActionLink(T("Register").Text, "Register") @T(" if you don't have an account.") }
@if (enableLostPassword)
{ @Html.ActionLink(T(" Lost your Password?").Text, "RequestLostPassword") }
</p>
@Html.ValidationSummary(T("Login was unsuccessful. Please correct the errors and try again.").ToString())
@using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new { ReturnUrl = Request.QueryString["ReturnUrl"] })))
{
<fieldset>
<legend>@T("Account Information")</legend>
<div class="clearfix">
<label for="username-email">@T("Username")</label>
<div class="input">
@Html.TextBox("userNameOrEmail", "", new { id = "username-email", autofocus = "autofocus" })
<span class="help-inline">@Html.ValidationMessage("userNameOrEmail")</span>
</div>
</div>
<div class="clearfix">
<label for="password">@T("Password")</label>
<div class="input">
@Html.Password("password")
<span class="help-inline">@Html.ValidationMessage("password")</span>
</div>
</div>
<div class="form-actions">
<button class="btn btn-primary btn-large" type="submit">@T("Sign In")</button>
</div>
</fieldset>
}
-----------------------------------------------------------------------------------------------------------------------
I cannot login. I read a previous post and tried removing the two @ symbols.
It rendered strangely when I did that. So it didn't work for me. I appreciate any help and I just wanted to report on the issue since I am struggling with it as well.

THANK YOU!

file attachments

No files are attached

comments

BertrandLeRoy wrote Fri at 11:46 PM

That doesn't seem like a core bug, but rather like your theme has an error in its logon.cshtml, right? Can we deal with that in discussions rather than the issue tracker?

<fieldset class="narrow row inline">
<label class="label_heading" for="Comment">ADD COMMENT</label>
</fieldset>
Nov 4, 2012 at 1:02 AM

Hello. Sorry for posting on "issue tracker". I am new to this site. 

I have re-posted as suggested on "discussions".

I am still having issues with logging in to my local site. I have older versions of the theme that I am using...

all of them have the same exact code as the one that I am having problems with.

Once again, my problem is that I cannot login to my Orchard site, and thus, dashboard when I run it in any browser.

The error is supposedly related to the LogOn.cshtml file but I see no problems with it, compared to files from other sites.

Any help would be appreciated, as I am completely hung up on this. I like Orchard, and I want to continue using it.

Nov 4, 2012 at 1:12 AM

It took me a while but here is the solution. Plain as day. Hope this helps anyone with the same problem.

https://github.com/OrchardCMS/OrchardDoc/blob/master/Documentation/Orchard-1-6-Release-Notes.markdown