Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
CS1061: 'ASP.sampleexample_aspx' does not contain a definition for 'Btnsave_Click' and no extension method 'Btnsave_Click' accepting a first argument of type 'ASP.sampleexample_aspx' could be found (are you missing a using directive or an assembly reference?)
Posted

It means you have added a button named Btnsave in desingning page and given a event to it named Btnsave_Click but you did not define it on .aspx.cs page.
Copy below code on .aspx.cs page and your error will not be displayed again
protected void Btnsave_Click(object sender, EventArgs e)
{
}
 
Share this answer
 
Comments
VICK 21-May-13 7:12am    
This solution seems to be perfect for mine.. although i am new to this field. & IT IS BIT IN REVERSE.. but shocked to see this one downvoted by someone. :(

i think who ever downvotes any solution should comment out the reason for that as well so that the one who posted that solution could improve his/her knowledge.
Hi Balu,

I think, you coded for Btnsave_Click in cs page and later you removed the code from it.
In aspx page remove the "onClick = Btnsave_Click" and now it will work.
This would remove the error I believe.

Regards,
RK
 
Share this answer
 
v2
As far as my short knowledge have debugged this type of errors multiple time, it shows that you have define a code chunk in .cs file but might be forgot to define the event against the user control in design page.

Do it and that gona fly ... :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900