I have problem with button control in my project, can't make it work:

when this:   <asp:Button ID="Button1" runat="server"  Text="Button" /
>  button is dead of course

but when I add event tag like this: <asp:Button ID="Button1"
runat="server"  Text="Button" OnClick="Button1_click" />  got
compilation error:



                              Server Error in '/'
Application.________________________________
                             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 'Button1_click' and no extension method 'Button1_click'
accepting a first argument of type 'ASP.default_aspx' could be found
(are you missing a using directive or an assembly reference?)
Source Error:
Line 91:                      <asp:Button ID="Button1" runat="server"
OnClick="Button1_click" Text="Button" />



even tough event clearly exists in c# code page:

                                 protected void Button1_click(object
sender, EventArgs e)
                                       {
                                                 "do something"
                                       }

But when I click on button on designer page it creates new code for
event  (Button1_Click1) , then I got this:

                                        protected void
Button1_click(object sender, EventArgs e)
                                               {
                                                  "do something"
                                                }

                                           protected void
Button1_Click1(object sender, EventArgs e)
                                              {

                                              }


-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to