Type or namespace could not be found

N

Nico Vonckx

Hello,

As I am taking my first steps in C#.NET i wrote this but I always receive an error message.

<%@ Page Language="C#" %>

<script runat="server">
void Submit_Click(object obj, Eventargs e) {
if (tbPass.Value == "mypass") {
Session["Username"] = tbUser.value;
Response.Redirect("oefening4.aspx");
} else {
Label1.Text = "<font color=red> That is the wrong password !</font>";
}
}
</script>

<html><body>

<form runat="server">
Please enter your username and password:<p>
<input type="text" id="tbUser"
runat="server"/><br>
<p>
<asp:Button id="btSubmit"
text="Submit"
runat="server"
OnClick="Submit_click"/><p>
<asp:label id="Label1" runat="server"/>
</form>
</body></html>

Error Message =
Compiler Error Message: CS0246: The type or namespace name 'Eventargs' could not be found (are you missing a using directive or an assembly reference?)

Anybody any idea please ,

Best regards

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
P

Peter K

Nico Vonckx wrote in
Error Message =
Compiler Error Message: CS0246: The type or namespace name 'Eventargs'
could not be found (are you missing a using directive or an assembly
reference?)

Maybe it is EventArgs?

/Peter
 
M

Morten Wennevik [C# MVP]

Hi Nico,

As Peter said, it is EventArgs (capital A). C# is case sensitive and
won't understand Eventargs, thinking it is a type or namspace you have
defined somewhere. Since it can't find out where it is, the compiler will
suggest a missing using directive or assembly reference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top