Hello ,  I have a problem with button control in asp.net 4 in Visual
Studio 2010,  c#

Can't make button to work , when control tag is this:


                        <asp:Button ID="Button1" runat="server"  Text="Button" 
/>

button is dead, of course.

But when I enter event:

                        <asp:Button ID="Button1" runat="server"  Text="Button"
OnClick="Button1_click" />

I got compilation error:



                        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"
Text="Button" OnClick="Button1_click" />


even tough even code certanly exists:

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

But when I click on button in designer mode it takes me to new event,
then i got this in c# code:


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

                         protected void Button1_Click1(object sender, EventArgs 
e)
                                   {

                                   }

And then when I enter "do something!" into new event code
Button1_Click1,  got same compilation error again !!!


I tried to delete all buttons and recreate them all over again  - same
problem.

But interestingly, when I created new empty project on same system,
button controls work properly.


Does anybody have a clue what may be a problem ?? Anybody got this
experience???

Is this maybe bug in VS2010 that Service Pack 1 may solve??   .... or
is it me?

Thank you

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