Thursday, July 25, 2013

Compilation Error CS1061: 'ASP.default_aspx' does not contain a definition for 'abc_CheckChanged'...

Hi Readers,
Greetings.

After long time....
Actually i am on my way to revise some basic concepts, during one program compilation i got the below error. After spending some time found the cause which turned me to think about one small mistake. Thought to share others, so that their time can be save.

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: 'ASP.default_aspx' does not contain a definition for 'chkTest_CheckChanged' and no extension method 'chkTest_CheckChanged' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)


Cause: There could be other causes too. But for my instance the cause is,
i made the event function to private. Which caused the issue.

Solution: Took of the private and made the event function to public. And my problem solved.
 

    private void chkTest_CheckChanged(object sender, EventArgs e)
        {
            GetRows();
            -------

        }

   public void chkTest_CheckChanged(object sender, EventArgs e)
        {
            GetRows();
            -----
        }


Regards,
Ravi

No comments:

Post a Comment