Can not find controls in TabTemplate

3 posts, 0 answers
  1. Elton
    Elton avatar
    98 posts
    Member since:
    Oct 2007

    Posted 02 Jun 2008 Link to this post

    Hello guys,

    I m trying to find some controls using javascript like this:

    var cflTabOrderId  = '<%=cflTabOrder.ClientID%>';

    but I got error:

    "The name 'cflTabOrder' does not exist in the current context"

    The tags is like:

         <telerik:RadTabStrip ID="tbMain" runat="server" MultiPageID="RadMultiPage1" AutoPostBack="false" width="100%" EnableViewState="false" OnClientTabSelected="tsRadTabStrip1_ClientTabSelected" 
            SelectedIndex="0" Skin="Office2007" style="" CausesValidation="false" OnTabCreated="tbMain_TabCreated" OnClientTabSelecting="tsRadTabStrip1_ClientTabSelecting">  
            <Tabs> 
                  
                <telerik:RadTab ID="tabOrder" runat="server" Text="<img id='errTabOrder' alt='' title='invalid input' src='../../_common/image/form/err.gif' style='display:none;float:left; border:none'/>order" PageViewID="pvOrder" Value="pvOrder" EnableViewState="false">  
                    <TabTemplate>                         
                        <asp:Image ID="cflTabOrder" SkinID="imgConflictImage" runat="server" ToolTip="data conflict" style="padding-top:2px;display:none;float:left; border:none"/>                      
                        <asp:CustomValidator ID="cvTabOrder" runat="server" Display="Dynamic" style="vertical-align:bottom" 
                            ErrorMessage="input error" Text="<img src='../../_common/image/form/err.gif' />" 
                            ToolTip="input error"  ClientValidationFunction="cvTabOrder_clientValidate" ValidateEmptyText="true" 
                             ValidationGroup="vgUpdate">  
                        </asp:CustomValidator> 
                        order details                      
                     </TabTemplate> 
                </telerik:RadTab> 
                  
                <telerik:RadTab ID="tabBrochures" runat="server" Text="<img id='errTabBrochure' alt='' title='invalid input' src='../../_common/image/form/err.gif' style='display:none;float:left; border:none'/>brochures" PageViewID="pvBrochures" Value="pvBrochures" EnableViewState="false">  
                    <TabTemplate>      
                        <img id='cflTabOrder2' alt='' title='data conflict' src="../../_common/image/grid/conflict.jpg" style='padding-top:2px;display:none;float:left; border:none'/>                                           
                        <asp:CustomValidator ID="cvTabBrochure" runat="server" Display="Dynamic" 
                            ErrorMessage="input error" Text="<img src='../../_common/image/form/err.gif' />" 
                            ToolTip="input error"  ClientValidationFunction="" ValidateEmptyText="true" 
                             ValidationGroup="vgUpdate">  
                        </asp:CustomValidator> 
                          
                        brochures  
                     </TabTemplate> 
                </telerik:RadTab> 
                <telerik:RadTab ID="tabShipment" runat="server" Text="<img id='errTabShip' alt='' title='invalid input' src='../../_common/image/form/err.gif' style='display:none;float:left; border:none'/>ship to" PageViewID="pvShipment" Value="pvShipment" EnableViewState="false">  
                </telerik:RadTab> 
            </Tabs> 
              
        </telerik:RadTabStrip>  
    Also I can not use this control from code behide.
    Just wonder why the control is invisible?

    Regards,
    Elton
  2. Elton
    Elton avatar
    98 posts
    Member since:
    Oct 2007

    Posted 09 Jun 2008 Link to this post

    come on Telerik,
    This question has been here for a week. It's igored or sth?
    You respond very quick before. what is happening now?

  3. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 11 Jun 2008 Link to this post

    Hi Elton,

    Please find below a sample code snippet that shows the needed approach.

    <form id="form1" runat="server">  
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
     
        <script type="text/javascript">  
        function getToolTip()  
        {  
            var myImage = $get('<%= ((Image)tbMain.FindTabByValue("pvOrder").FindControl("cflTabOrder")).ClientID %>');  
            alert(myImage.title);  
        }  
        </script> 
     
        <telerik:RadTabStrip ID="tbMain" runat="server" MultiPageID="RadMultiPage1" AutoPostBack="false" Width="100%" EnableViewState="false" OnClientTabSelected="tsRadTabStrip1_ClientTabSelected" SelectedIndex="0" Skin="Office2007" Style="" CausesValidation="false" OnTabCreated="tbMain_TabCreated" OnClientTabSelecting="tsRadTabStrip1_ClientTabSelecting">  
            <Tabs> 
                <telerik:RadTab ID="tabOrder" runat="server" Text="<img id='errTabOrder' alt='' title='invalid input' src='../../_common/image/form/err.gif' style='display:none;float:left; border:none'/>order" PageViewID="pvOrder" Value="pvOrder" EnableViewState="false">  
                    <TabTemplate> 
                        <asp:Image ID="cflTabOrder" SkinID="imgConflictImage" runat="server" ToolTip="data conflict" Style="padding-top: 2px; display: none; float: left; border: none" /> 
                        <asp:CustomValidator ID="cvTabOrder" runat="server" Display="Dynamic" Style="vertical-align: bottom" ErrorMessage="input error" Text="<img src='../../_common/image/form/err.gif' />" ToolTip="input error" ClientValidationFunction="cvTabOrder_clientValidate" ValidateEmptyText="true" ValidationGroup="vgUpdate">     
                        </asp:CustomValidator> 
                        order details  
                    </TabTemplate> 
                </telerik:RadTab> 
                <telerik:RadTab ID="tabBrochures" runat="server" Text="<img id='errTabBrochure' alt='' title='invalid input' src='../../_common/image/form/err.gif' style='display:none;float:left; border:none'/>brochures" PageViewID="pvBrochures" Value="pvBrochures" EnableViewState="false">  
                    <TabTemplate> 
                        <img id='cflTabOrder2' alt='' title='data conflict' src="../../_common/image/grid/conflict.jpg" style='padding-top: 2px; display: none; float: left; border: none' /> 
                        <asp:CustomValidator ID="cvTabBrochure" runat="server" Display="Dynamic" ErrorMessage="input error" Text="<img src='../../_common/image/form/err.gif' />" ToolTip="input error" ClientValidationFunction="" ValidateEmptyText="true" ValidationGroup="vgUpdate">     
                        </asp:CustomValidator> 
                        brochures  
                    </TabTemplate> 
                </telerik:RadTab> 
                <telerik:RadTab ID="tabShipment" runat="server" Text="<img id='errTabShip' alt='' title='invalid input' src='../../_common/image/form/err.gif' style='display:none;float:left; border:none'/>ship to" PageViewID="pvShipment" Value="pvShipment" EnableViewState="false">  
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <input id="Button1" type="button" value="button" onclick="getToolTip()" /> 
    </form> 

    On aside note, please note that a post in the Support Forums doesn't guarantee you a response from the Telerik support team although 95% of all posts are eventually answered. Additionally, a post is not assigned a response time as with the support ticketing system. In case you need a faster and precise response, please start a new support ticket as it gets higher priority than Forum posts.

    Greetings,
    Paul
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top