Error compiling template "/Designs/bleau-solutionset/Paragraph/newsletter_login.cshtml"
Line 30: 'Dynamicweb.Security.UserManagement.User' does not contain a definition for 'UserID' and no extension method 'UserID' accepting a first argument of type 'Dynamicweb.Security.UserManagement.User' could be found (are you missing a using directive or an assembly reference?)
Line 50: The name 'Database' does not exist in the current context
Line 52: 'Dynamicweb.Security' is a 'namespace' but is used like a 'type'
Line 52: 'Dynamicweb.Security' is a 'namespace' but is used like a 'type'

1 @using System.Web; 2 @using Dynamicweb; 3 @using Dynamicweb.Extensibility; 4 5 @if (Pageview.User.UserID == 0) { 6 7 <div class="event-create"> 8 <div class="changeNewsLetterdiv" data-login-box-mode="login"> 9 10 @if (!string.IsNullOrWhiteSpace(System.Web.HttpContext.Current.Request["username"])) { 11 var userpassword = ""; 12 var username = System.Web.HttpContext.Current.Request["username"]; 13 var sql = "select top(1) AccessUserPassword from AccessUser where AccessUserUserName='" + @username + "'"; 14 userpassword = Base.ChkString(Database.ExecuteScalar(sql)); 15 16 Dynamicweb.Security security = new Dynamicweb.Security(); 17 security.ExtranetLogin(username, userpassword, true); 18 19 <div></div> 20 21 if (!security.UserLoggedIn) 22 { 23 <div><b>E-mail findes ikke, eller er ikke aktiveret</b></div> 24 } else { 25 System.Web.HttpContext.Current.Response.Redirect("/default.aspx?ID=" + Pageview.Page.ID); 26 } 27 } 28 29 <table border="0" cellspacing="0" cellpadding="0" class="changeNewsLetter"> 30 <tr> 31 <td align="left"> 32 <form id="NewsLetterV3LoginForm" class="form-horizontal" method="post"> 33 <label for="NewsLetterV3LoginEmail">E-mail: </label> 34 <p><input type="text" id="login-username" name="username" class="form-control field" spellcheck="false" value='@System.Web.HttpContext.Current.Request["username"]'/></p> 35 <p><input type="submit" id="NewsLetterV3LoginSubmit" name="NewsLetterV3LoginSubmit" value="Login" class="button" /></p> 36 </form> 37 </td> 38 </tr> 39 </table> 40 </div> 41 </div> 42 } 43