title: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute
body: <pre><code>namespace ASPMultilingual { 
  public partial class _Default : System.Web.UI.Page
  {
      ResourceManager rm;
      CultureInfo ci;
      protected void Page_Load(object sender, EventArgs e)
      {
          if (Session["Lang"] == null) { 
              Session["Lang"] ="en-US";
          }
  
          if (!IsPostBack)
          {
              LoadString();
  
          }
  
      }
  
      private void LoadString(){
  
          Thread.CurrentThread.CurrentCulture = new CultureInfo(Session["Lang"].ToString());
          //rm = new ResourceManager("ASPMultilingual.App_GlobalResources.Lang", Assembly.GetExecutingAssembly());
          ResourceManager rm = new ResourceManager("ASPMultilingual.Lang", System.Reflection.Assembly.Load("ASPMultilingual"));
          ci = Thread.CurrentThread.CurrentCulture;
  
  
          btnLogIn.Text = rm.GetString("Login", ci);
      }
  
      protected void btnLogIn_Click(object sender, EventArgs e)
      {
          string ID = Request.Form["txtID"];
          String password = Request.Form["txtPassword"];
          string strConString = ConfigurationManager.ConnectionStrings["SOConnectionString"].ConnectionString;
          OleDbConnection conn = new OleDbConnection(strConString);
          OleDbCommand cmd = new OleDbCommand("SELECT * FROM USERMASTER", conn);
  
          try
          {
  
              conn.Open();
              OleDbDataReader dr;
  
              dr = cmd.ExecuteReader();
              while (dr.Read()) {
                  string testposition = dr["UserPosition"].ToString();
                  string dataID = dr["UserId"].ToString();
                  string dataPass = dr["UserPwd"].ToString();
                  if (dataPass == txtPassword.Text &amp;&amp; dataID == txtID.Text)
                  {
                      Session["User_Position"] = testposition;
                      Response.Redirect("Default2.aspx");
                  }
                  else {
  
                      lblError.Text = "Invalid account! Please Enter again!";
              }
  
              }
  
  
          }
          catch (Exception ex)
          {
              txtID.Text = "ex";
              lblError.Text = ex.ToString();
  
  
          }
          finally
          {
              conn.Close();
              conn.Dispose();
          }
  
  
          //Response.Redirect("Default2.aspx");
          //ClientScript.RegisterStartupScript(this.GetType(), "yourMessage", "alert('" + ID + " " + password + "');", true);
  
      }
  
      protected void ddLang_SelectedIndexChanged(object sender, EventArgs e)
      {
          Session["Lang"] = ddLang.SelectedValue;
          LoadString();
      }
  }
  }
  </code></pre>
  
  <p>The code running fine until I wich to add namespace on top of the code then its throw me the error. </p>
  
  <p>Compilation Error
  Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.</p>
  
  <p>Compiler Error Message: </p>
  
  <blockquote>
    <p>ASPNET: Make sure that the class defined in this code file matches the
    'inherits' attribute, and that it extends the correct base class (e.g.
    Page or UserControl).</p>
  </blockquote>
  
  <p>Source Error:
  Line 19:     public partial class _Default</p>