DavidKnight
Programmer
I'm a VB.NET developer trying to wotk in the C# environment. I ran into a funny situation that I have not run into while working in a VB webform.
I copy and paste an existing Standard.Button "Button1" in Design view and endup with the follow HTML Source code:
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Style="z-index: 100; left: 276px; position: absolute; top: 15px" Text="Button" />
<asp:Button ID="Button2" runat="server" OnClick="Button1_Click" Style="z-index: 100; left: 278px; position: absolute; top: 55px" Text="Button" />
</div>
</form>
Why does the Copied Button "Button2" have its OnClick event set to "Button1_Click"? What am I missing? Do I have to check each time I copy an object in Design View?
This seems to be a major difference from VB to C# in the handling of Button objects. The VB environment handles the OnClick in the code behind. (OnClick in VB isn't even available on the HTML side.) Where in C# it does the OnClick in the HTML and not in the code behind.
Thanks in advance for the help;
David
I copy and paste an existing Standard.Button "Button1" in Design view and endup with the follow HTML Source code:
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Style="z-index: 100; left: 276px; position: absolute; top: 15px" Text="Button" />
<asp:Button ID="Button2" runat="server" OnClick="Button1_Click" Style="z-index: 100; left: 278px; position: absolute; top: 55px" Text="Button" />
</div>
</form>
Why does the Copied Button "Button2" have its OnClick event set to "Button1_Click"? What am I missing? Do I have to check each time I copy an object in Design View?
This seems to be a major difference from VB to C# in the handling of Button objects. The VB environment handles the OnClick in the code behind. (OnClick in VB isn't even available on the HTML side.) Where in C# it does the OnClick in the HTML and not in the code behind.
Thanks in advance for the help;
David