how to find all rad controls in asp.net page

2 posts, 0 answers
  1. Sameer
    Sameer avatar
    2 posts
    Member since:
    Jan 2014

    Posted 24 Jan 2014 Link to this post

    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...
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 27 Jan 2014 in reply to Sameer Link to this post

    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
Back to Top