Button Authentication redirect not working RRS feed

  • Question

  • User390177474 posted

    Hello. I am implementing owin authentication for an existing webforms application.

    I am trying to make my login button redirect the user to Authentication with microsoft.

    This is my method in my LoginPage.aspx.cs:

    protected void LoginClicked(object sender, DirectEventArgs e)
               if (!Request.IsAuthenticated)
                   new AuthenticationProperties { RedirectUri = "/" },

    This is my button in LoginPage.aspx:

    <ext:Button ID="LoginButton" runat="server" MarginSpec="40 0 0 0" Text="Log in with Microsoft" Scale="Large" AnchorHorizontal="100%" IDMode="Static" Cls="loginBtn">
                                        <Click OnEvent="LoginClicked">

    But when I try to click on the button, my site just refreshes and nothing happens. I also tried adding the authentication-challenge to PageLoad. This works. But the button won't work. Any ideas?

    Wednesday, June 17, 2020 11:32 AM


  • User390177474 posted

    I solved it by adding 


    to my button.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 29, 2020 8:59 AM

All replies