Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7193205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:07:19+00:00 2026-05-28T20:07:19+00:00

I have a login control in login.aspx page that validates user by checking in

  • 0

I have a login control in login.aspx page that validates user by checking in database for username password using a stored procedure(Validation() method given below).I have used the following code

  protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
    if (Validation(Login1.UserName, Login1.Password))
    {

        Session["Logged"] = "Yes";
        Session["User"] = "Admin";
        Session["msg"] = "";
        e.Authenticated = true;
        Response.Redirect("/umkgp/admin/gallerymanager.aspx");
      //  "Successfully Logged In";

    }
     else
    {
        e.Authenticated = false;
    }

  }

Now when I am using LoginStatus control it is not changing display text from login to logout.I know that LoginStatus control based on IsAuthenticated property.In my case i guess IsAuthenticated is not set to true.How to make it work.Here is the code for LoginStatus control

 <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                <AnonymousTemplate>
                    [ <a href="/umkgp/admin/admin.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
                </AnonymousTemplate>
                <LoggedInTemplate>
                    Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                    [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="/umkgp/home.aspx" OnLoggingOut="Logout_Click"/> ]
                </LoggedInTemplate>
            </asp:LoginView>

(n.b.I have not used membership or roles).Please help me…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:07:20+00:00Added an answer on May 28, 2026 at 8:07 pm

    Replace this line

     Response.Redirect("/umkgp/admin/gallerymanager.aspx");
    

    with this one

         FormsAuthentication.RedirectFromLoginPage(Login1.UserName,false);
       //this will tell the asp.net who logged in and it will redirect to the requested page or the default page
    

    Update: If you want to set a default location go open your web.cofig file and find the authentication tag

    and modify it this way

    <authentication mode="Forms">
      <forms defaultUrl="~/mydefaultpage.aspx"/>
    </authentication>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Normally we have login page with username, password filed and signin button. Using the
I'm new to web development. I have a login.aspx page that has an Asp.Net
i have a login control and a create user control i my web page...i
I have an aspx Login control and I would like to center it on
I have an ASP.NET login control on a page, with the Remember Me checkbox
I have a createuserwizard and a login control on a page. both of them
I have an ASP.NET web page with a Login control on it. When I
I'm creating a login page. I want to create ASP.NET TextBox controls that have
Here's my setup. I'm using .NET: I have a Main.aspx lets call it. That
I'm using the ASP.NET/C# Login control and that entire authentication and authorization system. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.