Formview and button
May 10, 2008 at 8:44 am | In ASP.NET Tips | Leave a CommentHi,
I have problems with code-behind. In my code behind I have this code:
private void InitializeComponent()
{
this.Button2.Click += new System.EventHandler(this.Button1_Click);
The Button2 I have in Formview with ID=Formview2 :
<asp:FormView ID=”FormView2″ runat=”server” DataSourceID=”SqlDataSource2″ >
<InsertItemTemplate
>
<asp:button id=”Button2″ runat=”server” Text=”Ulož na server”></asp:butto>
And when I launch it, so Compiler say this:
Compiler Error Message: CS0117: ‘Detail’ does not contain a definition for ‘Button1′
Source Error:
| Line 54: Line 55: { Line 56: this.Button1.Click += new System.EventHandler(this.Button1_Click); |
No Comments Yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.