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

  • Home
  • SEARCH
  • 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 8138555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:31:36+00:00 2026-06-06T11:31:36+00:00

I encountered this error: The type or namespace name ‘WebControls’ could not be found

  • 0

I encountered this error:

The type or namespace name ‘WebControls’ could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 28:  Login Login1 = (WebControls.Login)LoginView1.FindControl("Login1"); // here the error code
Line 29:  TextBox UserName = (TextBox)Login1.FindControl("UserName");
Line 30:  TextBox FailureText = (TextBox)Login1.FindControl("FailureText");

I did some research and the solution was to add this into the source code:

System.Web.UI.WebControls.Login

but I have no idea where this code can be add into.
At first I tried putting it as a namespace, but it was wrong.
Anyone can tell me where should I place this code at??

EDIT

  protected void Login1_LoginError(object sender, System.EventArgs e)
{
    //Login Login1 = (WebControls.Login).LoginView1.FindControl("Login1");


    Login Login1 = (System.Web.UI.WebControls.Login)LoginView1.FindControl("Login1");
        TextBox UserName = (TextBox)Login1.FindControl("UserName");
        TextBox FailureText = (TextBox)Login1.FindControl("FailureText");

    //There was a problem logging in the user
    //See if this user exists in the database

    MembershipUser userInfo = Membership.GetUser(UserName.Text);
    if (userInfo == null)
    {
        //The user entered an invalid username...

        FailureText.Text = "There is no user in the database with the username " + UserName.Text;
    }
    else
    {
        //See if the user is locked out or not approved
        if (!userInfo.IsApproved)
        {
            FailureText.Text = "When you created your account you were sent an email with steps to verify your account. You must follow these steps before you can log into the site.";
        }
        else if (userInfo.IsLockedOut)
        {
            FailureText.Text = "Your account has been locked out because of a maximum number of incorrect login attempts. You will NOT be able to login until you contact a site administrator and have your account unlocked.";
        }
        else
        {
            //The password was incorrect (don't show anything, the Login control already describes the problem)
            FailureText.Text = string.Empty;
        }
    }
}
  • 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-06-06T11:31:39+00:00Added an answer on June 6, 2026 at 11:31 am

    You probably want to add

    using System.Web.UI.WebControls;
    

    at the top of your file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I encountered this error: Cannot implicitly convert type System.Web.UI.WebControls.LoginView to Login The error occured
I have encountered this error when trying to delete a cell, using a custom
Using NHibernate 1.x we encountered this error, suddently, during a nigthly job: 25/06/2012 22:50:59
During some set operations I encountered this error in Python: TypeError: unhashable type: 'InstrumentedList'
This was the first time I encountered this kind of error after dealing with
UPDATE 6/25/10 Using Google , I am not the only person to encounter this
I get this error: HTTP Status 500 - type Exception report message descriptionThe server
I've encountered a compiler error using Visual Studio 2010 which I've reduced down to
This is the weirdest error I have ever encountered. This MVC web project was
I encountered this error: cannot convert 'V_DTLPROMO_BTN_FN_T' to 'V_DTLPROD_BTN_FN_T' in argument passing in code

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.