Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works


  • Please log in to reply



    New Member

  • Member
  • Pip
  • 7 posts
I am trying to understand namespaceing... I was trained in Java but the company I work for uses C#... Can someone shed some light for me please..

Below is code for a login... But I keep getting errors on the namespacing...

asp code:
<%@ Page Language="C#" MasterPageFile="~/MasterPage3.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Edcc" Title="SignOn" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<form action="Login.aspx" method="post" runat="server">
<p align="center" style=font-size:xx-large>
East Divisional Call Center</p>
<p align="center">
<asp:Label ID="Message" runat="server"></asp:Label>
<h3 align="center">Login Form</h3>
<div align="center">
Login:<asp:TextBox ID="txtLogin" Width="200" runat="server" />
<asp:RequiredFieldValidator ControlToValidate="txtLogin" Display="Static" Font-Names="Verdana, arial, sans-serif"
ForeColor="red" Font-Size="9pt" ErrorMessage="Incorrect UserId Entered." runat="server"
ID="RFVLogin" />
Password:<asp:TextBox ID="txtPassword" Width="200" runat="server" TextMode="Password" />
<asp:RequiredFieldValidator ControlToValidate="txtPassword" Display="Static" Font-Names="Verdana, arial, sans-serif"
ForeColor="red" Font-Size="9pt" ErrorMessage="Incorrect Password Entered." runat="server"

<div align="center" >
<asp:Button ID="btnSignIn" runat="server" Text="Sign In" OnClick="btnSignIn_Click" Width="64px" />



Code Behind:

using System;
using System.Data;
using System.Data.Sql;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.SessionState;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public class Login : System.Web.UI.Page
public System.Web.UI.WebControls.Label Message;
public System.Web.UI.HtmlControls.HtmlTable tblSignIn;
public System.Web.UI.WebControls.TextBox txtLogin;
public System.Web.UI.WebControls.RequiredFieldValidator RFVLogin;
public System.Web.UI.WebControls.TextBox txtPassword;
public System.Web.UI.WebControls.RequiredFieldValidator RFVPassword;
public System.Web.UI.WebControls.Button btnSignIn;

protected void Page_Load(object sender, EventArgs e)

if ( !IsPostBack )
//Display welcome message
Message.Text = "Enter your login and password.";
protected void btnSignIn_Click(Object obj, EventArgs e)
//Check username/password against Emp_DB_Employee database
SQLConnection conn = new

//get row back based on username/password
string strsql = "Select * from Emp_DB_Employee where Id='" +
txtLogin.Text + "' and Password = '" +
txtPassword.Text + "'";

SQLDataSetCommand dsc = new SQLDataSetCommand(strsql, conn);

//populate a dataset with SQL results
DataSet ds = new DataSet ();
dsc.FillDataSet(ds, "Emp_DB_Employee" );

//check to see if the dataset contains no rows (if it is EOF) user is invalid
if(ds.Tables ["Emp_DB_Employee"].Rows.Count ==0)
Message.Text = "Invalid User Name and Password. Try Again.";
Message.Text = "Congratulations, " + txtLogin.Text +
"!!! You have successfully signed in.";

this is the error I keep getting??????

Error 4 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). C:\_Programming\Website Testing\Gina WebSite\Login.aspx.cs 1 33 C:\...\Gina WebSite\

Thank you for any help you can give

  • 0





  • Member
  • PipPip
  • 12 posts
what makes you think this is a namespace problem? (just to clarify)
  • 0



    New Member

  • Topic Starter
  • Member
  • Pip
  • 7 posts
Hi Stephen,

Thank you for your response... But I figured out what I was missing...

it was in the inherit part on the ASPX page :whistling:
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP