asp.net mvc - Trying to create drop down login for Orchard CMS -


i new orchard , asp.net mvc. trying override login process users instead of going dedicated login page (the default process) drop down form user menu logs them in. have created overrides in custom theme logon.cshtml , user.cshtml. code follows:

//user.cshtml @using system.web.mvc; @using orchard.contentmanagement;  <nav class="navbar navbar-default navbar-fixed-top">     <div class="container-fluid">         <ul class="nav navbar-nav pull-right">         @if (workcontext.currentuser != null) {             <li class="dropdown">                 <button id="userdropdown" class="btn btn-primary navbar-btn dropdown-toggle" data-toggle="dropdown">                     welcome @html.itemdisplaytext(workcontext.currentuser) <span class="caret"></span>                 </button>                 <ul class="dropdown-menu">                     <li>                         @html.actionlink(t("change password").tostring(), "changepassword", new { controller = "account", area = "orchard.users" })                     </li>                     <li>                         @html.actionlink(t("sign out").tostring(), "logoff", new { controller = "account", area = "orchard.users", returnurl = context.request.rawurl }, new { rel = "nofollow" })                     </li>                     @if (authorizedfor(orchard.security.standardpermissions.accessadminpanel)) {                         <li class="divider"></li>                         <li>                             @html.actionlink(t("dashboard").tostring(), "index", new { area = "dashboard", controller = "admin" })                         </li>                     }                 </ul>             </li>         }         else {             <li class="dropdown">                 <button class="btn btn-primary navbar-btn dropdown-toggle" data-toggle="dropdown">                     sign in <span class="caret"></span>                 </button>                 <ul class="dropdown-menu dropdown-menu-right">                     <li>                         @display.logon()                     </li>                 </ul>             </li>         }     </ul> </div> 

//logon.cshtml @using system.web.mvc; @using orchard.contentmanagement;  <div> @using (html.beginformantiforgerypost(url.action("logon", new { returnurl = request.querystring["returnurl"] }))) {     <fieldset class="login-form group">         <legend>@t("account information")</legend>         <div class="form-group">             <label for="username-email">@t("username")</label>             @html.textbox("usernameoremail", "", new { id = "username-email", autofocus = "autofocus", @class = "validate[required]" })             @html.validationmessage("usernameoremail")         </div>         <div class="form-group">             <label for="password">@t("password")</label>             @html.password("password", null, new { @class = "validate[required]" })             @html.validationmessage("password")         </div>         <div class="checkbox">             <label class="forcheckbox" for="remember-me">                 @html.checkbox("rememberme", new { id = "remember-me" }) @t("remember me")             </label>         </div>         <div class="form-group">             <button class="primaryaction" type="submit">@t("sign in")</button>         </div>     </fieldset> } </div> 

the form displays fine in dropdown, when submit button clicked, http 404 error: requested url: /orchardlocal/contents/item/logon.

i'm afraid default login process requires separate view. i've been trying figure out existing override use, i'm not seeing it. appreciated. thanks.

you should able login changing form from

@using (html.beginformantiforgerypost(url.action("logon", new { returnurl = request.querystring["returnurl"] }))) 

to this:

@using ( html.beginform("logon", "account", new { area = "orchard.users" /*other route values here*/ }, formmethod.post) ) {     @html.antiforgerytoken()      // ... stuff here } 

this same every other controller action. if in doubt: specify area explicitly.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -