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 6864593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:55:51+00:00 2026-05-27T02:55:51+00:00

I have a form called frmLogin. I have code within the Login_1Authenticate event handler

  • 0

I have a form called frmLogin. I have code within the Login_1Authenticate event handler that checks the security level of the username and password entered. Then depending on the security level it will display or not display links on my main form called frmMain. If it is security level “A” I want full control, but if it security level “U” then I want link buttons and image buttons removed from frmMain. An example of two of them to disable are:

linkbtnEmployee
imgbtnNewEmployee

linkbtnViewUserActivity
imgbtnViewUserActivity

I need to write the code for the Page_Load event, but I’m not sure how to write it.
Here’s the code for my frmLogin page:

public partial class frmLogin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {

        dsUser dsUserLogin;


        string SecurityLevel;


        dsUserLogin = clsDataLayer.VerifyUser(Server.MapPath("PayrollSystem_DB.mdb"),
                         Login1.UserName, Login1.Password);


        if (dsUserLogin.tblUserLogin.Count < 1)
        {
            e.Authenticated = false;
            return;
        }


        SecurityLevel = dsUserLogin.tblUserLogin[0].SecurityLevel.ToString();


        switch (SecurityLevel)
        {

            case "A":
                // Add your comments here
                e.Authenticated = true;
                Session["SecurityLevel"] = "A";
                break;
            case "U":
                // Add your comments here
                e.Authenticated = true;
                Session["SecurityLevel"] = "U";
                break;
            default:
                e.Authenticated = false;
                break;
        }
    }
}
  • 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-27T02:55:52+00:00Added an answer on May 27, 2026 at 2:55 am

    Well if you want them to be invisible use:

    linkbtnEmployee.Visible = false;
    imgbtnNewEmployee.Visible = false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WinForm project that contains a form called MainUI. You can see
For example, I have an ASP.NET form that is called by another aspx: string
I have a issue, I have a form called quicksearch CODE <form method=GET name=quicksearch
I have a register form called server with fields Name, IP, Password. The form
I have a tab in a windows form called Wafer Map that has three
I have a form with a submit button. I have called a function on
I have got a textbox on a form with a method being called from
Assume we have a single Windows form with a button called SimpleButton1. The following
I have a set of textboxes on a form, called sm1, sm2 etc, and
I have form that displays several keywords (standard set of choice lists that changes

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.