Why does it say that the TextBox doesn't exis , when it actually existt?

83 Views Asked by At

So I am using someone else's project I have copied the code from there's . So I have fixed most of the problems in the project , I only need to know how to fix this .

I am using asp.net 4.8 Framework

The problem :

**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.

Compiler Error Message: CS1061: 'login_aspx' does not contain a definition for 'txtuname_TextChanged' and no accessible extension method 'txtuname_TextChanged' accepting a first argument of type 'login_aspx' could be found (are you missing a using directive or an assembly reference?)**

Login.aspx.cs:

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

        }
        protected void btnlogin_Click(object sender, EventArgs e)
        {
 }

        protected void txtuname_TextChanged(object sender, EventArgs e)
        {

        }
    }
}

Look it exist why does it say it doesn't

Login.aspx(Source):

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Pulse_System.Login" %>

   <style type="text/css">
    .style2
    {
        width: 259px;
    }
    .style3
    {
        height: 8px;
    }
    .style4
    {
        height: 9px;
    }
    .style5
    {
        width: 100px;
    }
       .auto-style1 {
           text-align: center;
       }
   </style>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   
</head>
<body>  <table class="tbl" style = "object-position:center">
    <tr>
        <td class="auto-style1">
            User Login Area</td>
    </tr>
    <tr>
        <td class="auto-style1">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="auto-style1">
            <br />
            <br />
        </td>
    </tr>
    <tr>
        <td class="auto-style1">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <table style="text-align: center; border: thin solid #008000" class="style2" >
                <tr>
                    <td colspan="2">
                        Login Here</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        UserName :
                    </td>
                    <td>
                        <asp:TextBox ID="txtuname" runat="server" CssClass="txt" Width="140px" OnTextChanged="txtuname_TextChanged" style="padding:0px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="txtuname" ErrorMessage="Enter UserName" ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Password :
                    </td>
                    <td>
                        <asp:TextBox ID="txtpass" runat="server" CssClass="txt" Width="140px" 
                            TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="txtpass" ErrorMessage="Enter Password" ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style4">
                    </td>
                    <td class="style4">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td style="text-align: center; vertical-align:top">
                        <table class="style5">
                            <tr>
                                <td>
                                    <asp:Button ID="btnlogin" runat="server" CssClass="btn" Text="Login" 
                                        onclick="btnlogin_Click" />
                                </td>
                                <td>
                                    <asp:Image ID="Image3" runat="server" Height="44px" 
                                        ImageUrl="~/images/imagesds.jpg" Width="85px" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                    </td>
                    <td class="style3">
                        <asp:Label ID="lblerror" runat="server" ForeColor="#CC0000"></asp:Label>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="color: Green" class="auto-style1">
            Dont have Username and Password
            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Registration.aspx">Register Now !!</asp:HyperLink>
        </td>
    </tr>
</table>
</body>
</html>

It exist every where why doesn't it work?

I'v searched online andI have found somethin about changing the namespace it didn't change anything.

0

There are 0 best solutions below