This is a migrated thread and some comments may be shown as answers.

how to find all rad controls in asp.net page

1 Answer 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sameer
Top achievements
Rank 1
Sameer asked on 24 Jan 2014, 10:47 AM
hi support team

               can u please provide sample code for me to find all RAD CONTROLS in asp.net web page... i have many rad controls in my aspx page. i want to find all the controls server side...

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 27 Jan 2014, 12:39 PM
Hello,

Please try with the below code snippet.


foreach (var control in form1.Controls) //Page.Controls
        {
            if (control.GetType().Namespace == "Telerik.Web.UI")
            {
                //Your control is RAD control
            }
        }

<form id="form1" runat="server">
       <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
   </form>

In my page Form id is "form1" so i have used form1 in above code snippet.

Thanks,
Jayesh Goyani
Tags
General Discussions
Asked by
Sameer
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or