I'm just getting started in Umbraco and trying to create a login page.
This is the login controller I've set up:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Umbraco.Web.Mvc;
using Umbraco.Web.Models;
namespace MyApp.Controllers
{
public class LoginController : SurfaceController
{
// GET: Login
public ActionResult Login(LoginModel model)
{
if (!ModelState.IsValid)
return CurrentUmbracoPage();
if (Members.Login(model.Username, model.Password))
return Redirect("/news");
ModelState.AddModelError("", "Invalid Login");
return CurrentUmbracoPage();
}
}
}
I then created a login document type in Umbraco, a piece of content using that type (URL = '/login'), and created a login view and added my partial view to this:
When I try and navigate to '/login' I'm getting the following compilation error:
Compiler Error Message: CS0234: The type or namespace name 'Login' does not exist in the namespace 'Umbraco.Web.PublishedContentModels' (are you missing an assembly reference?)
Source Error:
Line 40:
Line 41:
Line 42: public class PageViewsLogincshtml : Umbraco.Web.Mvc.UmbracoTemplatePage
Just wondering what I might need to update in my templates?
Login Page Compilation Error
Hi there,
I'm just getting started in Umbraco and trying to create a login page.
This is the login controller I've set up:
And this is the login partial view:
I then created a login document type in Umbraco, a piece of content using that type (URL = '/login'), and created a login view and added my partial view to this:
When I try and navigate to '/login' I'm getting the following compilation error:
Compiler Error Message: CS0234: The type or namespace name 'Login' does not exist in the namespace 'Umbraco.Web.PublishedContentModels' (are you missing an assembly reference?)
Source Error:
Line 40:
Line 41:
Line 42: public class PageViewsLogincshtml : Umbraco.Web.Mvc.UmbracoTemplatePage
Just wondering what I might need to update in my templates?
Hi Victoria,
First of all welcome to the friendliest community of Umbraco!
did you changed something to the web config for the
Modelsbuilder
or is this still the default?/Michaël
Hi Michaël,
Thanks for the warm welcome! :)
It's still using Pure Live for the models builder.
Cheers,
Victoria
is working on a reply...