I am using radtextbox on a form with no radgrid. I am trying to find the control using the findcontrol method but I have not been successful. The code is very simple:
And the code behind to find the control:
No matter what I do rtp comes up null...cannot find control. I am new to Telerik so it is probably something stupid but can you help?
Thanks,
Eric
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server" Skin="WebBlue" /> <div class="tablediv"><div class="rowdiv"><div class="celldivleft">First Name:</div><div class="celldivright"> <asp:TextBox ID="FirstNameBox" runat="server"></asp:TextBox></div></div> <div class="rowdiv"><div class="celldivleft">Last Name:</div><div class="celldivright"> <asp:TextBox ID="LastNameBox" runat="server"></asp:TextBox></div> </div> <div class="rowdiv"><div class="celldivleft">Last Name:</div><div class="celldivright"><telerik:RadTextBox ID="RadTextBox1" runat="server"> </telerik:RadTextBox></div> </div> <div class="rowdiv"> <div class="celldivleft"> </div> <div class="celldivright"> <asp:Button ID="SubmitButton" runat="server" Text="Submit" onclick="SubmitButton_Click" /> </div> </div> </div> </asp:Content>And the code behind to find the control:
protected void Page_InitComplete(object sender, EventArgs e) { RadTextBox rtb = (this.Page.FindControl("RadTextBox1") as RadTextBox); }No matter what I do rtp comes up null...cannot find control. I am new to Telerik so it is probably something stupid but can you help?
Thanks,
Eric