Click here to Skip to main content
14,660,942 members
Home » Discussions » ASP.NET
   

ASP.NET

 
GeneralRe: What is sub domain and its usage Pin
Rajesh Shirsagar30-Sep-16 0:29
MemberRajesh Shirsagar30-Sep-16 0:29 
QuestionCan't get MP4 video to play on IIS 7.5 Pin
David Mujica21-Sep-16 8:29
MemberDavid Mujica21-Sep-16 8:29 
AnswerRe: Can't get MP4 video to play on IIS 7.5 Pin
Richard Deeming21-Sep-16 8:58
mveRichard Deeming21-Sep-16 8:58 
GeneralRe: Can't get MP4 video to play on IIS 7.5 Pin
David Mujica22-Sep-16 5:17
MemberDavid Mujica22-Sep-16 5:17 
AnswerRe: Can't get MP4 video to play on IIS 7.5 Pin
ZurdoDev22-Sep-16 5:27
mveZurdoDev22-Sep-16 5:27 
GeneralRe: Can't get MP4 video to play on IIS 7.5 Pin
David Mujica22-Sep-16 6:10
MemberDavid Mujica22-Sep-16 6:10 
AnswerRe: Can't get MP4 video to play on IIS 7.5 Pin
K-SIS2-Oct-16 21:58
MemberK-SIS2-Oct-16 21:58 
QuestionASP.Net MVC: Request.IsAuthenticated getting false after successfully login Pin
Tridip Bhattacharjee20-Sep-16 5:20
professionalTridip Bhattacharjee20-Sep-16 5:20 
i am using asp.net MVC and identity to authenticate user. i saw after successfully authenticate
Request.IsAuthenticated return false


this is sample login code which i debug and saw it is working fine.
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
{
    if (!ModelState.IsValid)
    {
        return View(model);
    }

    // This doesn't count login failures towards account lockout
    // To enable password failures to trigger account lockout, change to shouldLockout: true
    var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);
    switch (result)
    {
        case SignInStatus.Success:
            return RedirectToLocal(returnUrl);
        case SignInStatus.LockedOut:
            return View("Lockout");
        case SignInStatus.RequiresVerification:
            return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
        case SignInStatus.Failure:
        default:
            ModelState.AddModelError("", "Invalid login attempt.");
            return View(model);
    }
}


after successfully login page redirect to home index action where i am showing user information in index view like below way but controls never come there because of Request.IsAuthenticated return false
<div class="row">
    <div class="col-md-12">
        @{
            if (Request.IsAuthenticated)
            {
                var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
                var currentUser = manager.FindById(User.Identity.GetUserId());
                <p>@currentUser.UserName</p>
                <p>@currentUser.BirthDate</p>
            }
            else
            {
                <p>not authenticated</p>
            }
        }

    </div>
</div>


just do not understand what i am missing for which request authenticate method always returning false. please help me to fix it. thanks
tbhattacharjee

AnswerRe: ASP.Net MVC: Request.IsAuthenticated getting false after successfully login Pin
Ram Kumar Kangeyan11-Dec-18 17:07
professionalRam Kumar Kangeyan11-Dec-18 17:07 
Questionweb form build options with javascript message Pin
dcof18-Sep-16 4:24
Memberdcof18-Sep-16 4:24 
AnswerRe: web form build options with javascript message Pin
ZurdoDev19-Sep-16 1:18
mveZurdoDev19-Sep-16 1:18 
QuestionVS2015: Difference between Bootstrap Snippets and Bootstrap Tags Pin
Harakiri198117-Sep-16 7:24
MemberHarakiri198117-Sep-16 7:24 
AnswerRe: VS2015: Difference between Bootstrap Snippets and Bootstrap Tags Pin
Keviniano Gayo19-Sep-16 1:30
MemberKeviniano Gayo19-Sep-16 1:30 
GeneralRe: VS2015: Difference between Bootstrap Snippets and Bootstrap Tags Pin
Harakiri198119-Sep-16 5:20
MemberHarakiri198119-Sep-16 5:20 
GeneralRe: VS2015: Difference between Bootstrap Snippets and Bootstrap Tags Pin
Keviniano Gayo19-Sep-16 6:15
MemberKeviniano Gayo19-Sep-16 6:15 
Questionweb form master page not displaying message Pin
dcof16-Sep-16 15:28
Memberdcof16-Sep-16 15:28 
QuestionregEx expression help Pin
313help9-Sep-16 9:54
Member313help9-Sep-16 9:54 
AnswerRe: regEx expression help Pin
ZurdoDev9-Sep-16 10:19
mveZurdoDev9-Sep-16 10:19 
AnswerRe: regEx expression help Pin
Nathan Minier10-Sep-16 2:51
professionalNathan Minier10-Sep-16 2:51 
SuggestionRe: regEx expression help Pin
Richard Deeming12-Sep-16 2:36
mveRichard Deeming12-Sep-16 2:36 
QuestionRun Query based on to other query result in asp Pin
26s11247-Sep-16 4:19
Member26s11247-Sep-16 4:19 
QuestionRe: Run Query based on to other query result in asp Pin
ZurdoDev7-Sep-16 5:53
mveZurdoDev7-Sep-16 5:53 
AnswerRe: Run Query based on to other query result in asp Pin
David Mujica7-Sep-16 8:16
MemberDavid Mujica7-Sep-16 8:16 
GeneralRe: Run Query based on to other query result in asp Pin
26s11247-Sep-16 8:31
Member26s11247-Sep-16 8:31 
QuestionThoughts on a Web CMS Pin
Foothill6-Sep-16 5:15
professionalFoothill6-Sep-16 5:15 

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.