how to get client id of RadTabStrip without using page parser?

Thread is closed for posting
2 posts, 0 answers
  1. Maruthi
    Maruthi avatar
    4 posts
    Member since:
    Jul 2012

    Posted 01 Aug 2012 Link to this post

    Hi,
    I am using this below  javascript function
    but the problem is
    how can i get client id withot using,  $find('<%= RadTabStrip1.ClientID%>');

    <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
    <script type="text/javascript">
    function UnSelectMyTab(sender, eventArgs)
                {
                    
                    var tabStrip = $find('<%= RadTabStrip1.ClientID%>');
                    if (!tabStrip) return;
                    //Find the element which the mouse is over
                    var destElement = eventArgs.get_domEvent().eventMapRelatedTarget;
                    if ($telerik.isDescendant(tabStrip.get_element(), destElement))
                        return;
                    var initialTab = eventArgs.get_tab();
                    initialTab.unselect();
                    initialTab.selectParents();
                }
         </script>
    </telerik:RadCodeBlock>

    Can anyone let me know how to do this?

    Thanks,
    Maruthi
  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 06 Aug 2012 Link to this post

    Hi Maruthi,

    In general RadTabStrip is rendered as a "div" element - you can try selecting it by class name with JQuery and then you can obtain the div "id" attribute:
    <script type="text/javascript">
        function pageLoad() {
     
            var tabstripClientID = $telerik.$(".RadTabStrip");
            alert(tabstripClientID.attr("id"));
     
        }
    </script>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server"
        SelectedIndex="0" MultiPageID="RadMultiPage1">
    </telerik:RadTabStrip>

    If the issue persists – could you explain the scenario that you want to implement in more details?


    Regards,
    Kalina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top