Being too lazy to load up VWD, try using:
FormView1.Row.FindControl("Button1")
In a repeater, you'd have multiple "Button1"'s and would need to look at
repeater.Items[i].FindControl
FormViews are the same..though there's only 1 row...so it's exposed as Row
(if I remember correctly).
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Daves" <db****@simnet.is> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
hi,
sorry for re-posting but it's a simple question and ought to have a very
simple solution; I am trying to use Findcontrol to grab a Button control
within a Formview control:
<form ID="Form1" runat="server">
<asp:FormView ID="FormView1" Runat="server">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" Text="Breyta"
CommandName="Edit"/> ...
This is what won't work:
Button Button1 = (Button) FormView1.FindControl("Button1");