Dynamically added usercontrols not rendered like they should

2 posts, 0 answers
  1. Jef Claes
    Jef  Claes avatar
    4 posts
    Member since:
    Jul 2009

    Posted 22 Jul 2009 Link to this post

    Hi there

    I have a usercontrol called ReportContainer.

    This is the markup. 

    <telerik:RadScriptManager ID="scriptManager" runat="server" /> 
    <telerik:RadTabStrip ID="tsReport" runat="server"  
        ontabcreated="tsReport_TabCreated" >    
    </telerik:RadTabStrip> 
     

    And this is the codebehind.

     protected void Page_Load(object sender, EventArgs e) 
            { 
                if (!Page.IsPostBack) 
                { 
                    LoadTabs(); 
                } 
            } 
     
     
            private void LoadTabs() 
            { 
                RadTab radTabGeneral = new RadTab("General");            
                tsReport.Tabs.Add(radTabGeneral); 
                
     
            } 
     
            protected void tsReport_TabCreated(object sender, RadTabStripEventArgs e) 
            { 
                 TabGeneral tabGeneral = (TabGeneral)LoadControl(@"~\Report\Controls\Tabs\TabGeneral.ascx"); 
                 e.Tab.Controls.Add(tabGeneral); 
            } 

    The markup from the UserControl I try to add is this.

    khjhfsqfdsqfqsddfqsfsqfsqfsqfsq 
    <asp:FormView runat="server" ID="fvTabGeneral" DefaultMode="ReadOnly"
        <ItemTemplate> 
            ItemTemplate 
        </ItemTemplate> 
        <EditItemTemplate> 
            EditItemtemplate 
        </EditItemTemplate> 
    </asp:FormView> 

    The result looks like this.
    It should use the Text property for the Tab title and the content of the Tab should show '
    khjhfsqfdsqfqsddfqsfsqfsqfsqfsq ' 

    What am I doing wrong?
     
  2. Jef Claes
    Jef  Claes avatar
    4 posts
    Member since:
    Jul 2009

    Posted 23 Jul 2009 Link to this post

    Still looking for a solution..

    This is the outputted HTML.

    <div id="ctl00_MainContainer_rcMain_tsReport" class="RadTabStrip RadTabStrip_Default RadTabStripTop_Default "
        <!-- 2009.1.527.35 --><div class="rtsLevel rtsLevel1"
            <ul class="rtsUL"><li class="rtsLI rtsFirst rtsLast"><div class="rtsLink"
                <div class="rtsOut"
                    <div class="rtsIn"
                         
    khjhfsqfdsqfqsddfqsfsqfsqfsqfsq 
     
                    </div> 
                </div> 
            </div></li></ul> 
        </div><input id="ctl00_MainContainer_rcMain_tsReport_ClientState" name="ctl00_MainContainer_rcMain_tsReport_ClientState" type="hidden" /> 
    </div> 
     
     
                        </div> 
                    </td> 
                    <td id="contentRight">&nbsp;</td> 
                </tr> 
                <tr> 
                    <td id="footerText" colspan="3">                                 
                        <href="../Help/Help_Dim.b@_Verslag.htm" target="_blank"><span><img align="left" style="margin-left:25px;" src="../shared/images/icons/help.gif" height="22" alt="Help" /></span></a> 
                        <id="ctl00_lnkVersion" href="../iAuth/Version.aspx">KanoWeb v9.0.907.22005  </a>&copy; 2008 - Ferranti Computer Systems NV 
                    </td> 
                </tr> 
                <tr> 
                    <td id="footerLeft" style="height:10px; width: 11px;"></td> 
                    <td id="footerMid"></td> 
                    <td id="footerRight" style="height:10px; width: 11px;"></td> 
                </tr> 
            </table> 
        </div> 
         
     
    <script type="text/javascript"
    //<![CDATA[
    Sys.Application.initialize();
    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadTabStrip, {"_skin":"Default","clientStateFieldID":"ctl00_MainContainer_rcMain_tsReport_ClientState","tabData":[{"text":"General"}]}, null, null, $get("ctl00_MainContainer_rcMain_tsReport"));
    });
    //]]> 
    </script> 
    </form> 
    </body> 
    </html> 
     

Back to Top