Click here to Skip to main content
15,902,198 members
Home / Discussions / Web Development
   

Web Development

 
Questiongoogle map API biostall library issue on my project in codeigniter Pin
Member 135521401-Dec-17 5:13
Member 135521401-Dec-17 5:13 
QuestionMVCCodeRouting Pin
#realJSOP30-Nov-17 6:39
professional#realJSOP30-Nov-17 6:39 
AnswerRe: MVCCodeRouting Pin
Nathan Minier1-Dec-17 1:43
professionalNathan Minier1-Dec-17 1:43 
GeneralRe: MVCCodeRouting Pin
#realJSOP1-Dec-17 8:13
professional#realJSOP1-Dec-17 8:13 
GeneralRe: MVCCodeRouting Pin
Nathan Minier4-Dec-17 1:15
professionalNathan Minier4-Dec-17 1:15 
QuestionMVC and Custom Routes Pin
#realJSOP30-Nov-17 5:08
professional#realJSOP30-Nov-17 5:08 
AnswerRe: MVC and Custom Routes Pin
Richard Deeming30-Nov-17 8:24
mveRichard Deeming30-Nov-17 8:24 
GeneralRe: MVC and Custom Routes Pin
#realJSOP1-Dec-17 1:04
professional#realJSOP1-Dec-17 1:04 
QuestionHow do I insert dropdown Text, not the value, into the database? Pin
samflex17-Nov-17 9:58
samflex17-Nov-17 9:58 
AnswerRe: How do I insert dropdown Text, not the value, into the database? Pin
W Balboos, GHB6-Dec-17 7:27
W Balboos, GHB6-Dec-17 7:27 
GeneralMessage Closed Pin
24-Jan-19 11:19
Sarah George24-Jan-19 11:19 
GeneralRe: How do I insert dropdown Text, not the value, into the database? Pin
W Balboos, GHB25-Jan-19 1:14
W Balboos, GHB25-Jan-19 1:14 
GeneralRe: How do I insert dropdown Text, not the value, into the database? Pin
Richard Deeming25-Jan-19 2:33
mveRichard Deeming25-Jan-19 2:33 
QuestionOne Step Forward, Two Steps Back - Can't create controller using scaffolding Pin
#realJSOP10-Nov-17 2:04
professional#realJSOP10-Nov-17 2:04 
AnswerRe: One Step Forward, Two Steps Back - Can't create controller using scaffolding Pin
#realJSOP11-Nov-17 11:16
professional#realJSOP11-Nov-17 11:16 
QuestionSys.WebForms.Res is undefined when javascript executed inside updatepanel Pin
Claudio Trenca8-Nov-17 4:38
professionalClaudio Trenca8-Nov-17 4:38 
QuestionMVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 1:59
professional#realJSOP7-Nov-17 1:59 
AnswerRe: MVC5 - Logoff does not work in Chrome Pin
Richard Deeming7-Nov-17 2:22
mveRichard Deeming7-Nov-17 2:22 
John Simmons / outlaw programmer wrote:
What's the reason for that?

Because that's how it's declared in Views\Shared\_LoginPartial.cshtml:
@using Microsoft.AspNet.Identity
@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
    @Html.AntiForgeryToken()

    <ul class="nav navbar-nav navbar-right">
        <li>
            @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
        </li>
        <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
    </ul>
    }
}
else
{
    ...

It's using a <form> because the LogOff action in the AccountController requires a POST request:
C#
//
// POST: /Account/LogOff
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
    AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
    return RedirectToAction("Index", "Home");
}

This is done to prevent a forged request from another site from logging the user out of your site. If you're not worried about that, you could remove the [HttpPost] and [ValidateAntiForgeryToken] attributes to make the action accept a GET request, and then remove the form:
@using Microsoft.AspNet.Identity
@if (Request.IsAuthenticated)
{
    <ul class="nav navbar-nav navbar-right">
        <li>
            @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
        </li>
        <li>
            @Html.ActionLink("Log off", "LogOff", "Account")
        </li>
    </ul>
}
else
{
    ...
C#
//
// GET: /Account/LogOff
public ActionResult LogOff()
{
    AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
    return RedirectToAction("Index", "Home");
}

Otherwise, you'll need to work out why the javascript: link isn't working in Chrome. The developer console (F12) might have some clues.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: MVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 2:39
professional#realJSOP7-Nov-17 2:39 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
Richard Deeming7-Nov-17 2:45
mveRichard Deeming7-Nov-17 2:45 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 2:47
professional#realJSOP7-Nov-17 2:47 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
Richard Deeming7-Nov-17 2:53
mveRichard Deeming7-Nov-17 2:53 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 2:59
professional#realJSOP7-Nov-17 2:59 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
Richard Deeming7-Nov-17 3:03
mveRichard Deeming7-Nov-17 3:03 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 3:01
professional#realJSOP7-Nov-17 3:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.