Different Tab for different aspx. How to persist the aspx page?

4 posts, 0 answers
  1. Daniel
    Daniel avatar
    5 posts
    Member since:
    Mar 2011

    Posted 01 Jul 2011 Link to this post

    Am in the midst of moving codes to telerik and having some difficulty converting. The page i am working on has a treeview which is used for main navigation. on click it would load the relevant aspx page to a new tab. Been trying to look for answers and this is the best i could come to. It is able to load the pages correctly now, but each time i switch to another tab and then back, it would reset any data entry i made. Point here is the user should be able to do data entry on one tab and switch to another tab to do other stuff and then come back to continue what they are doing. Hope you can provide some pointers :) Thanks

    ASPX

    <telerik:RadTreeView ID="TreeView1" Runat="server" Skin="Hay" Font-Names="Verdana" Font-Size="9px" onnodeclick="TreeView1_NodeClick">
    </telerik:RadTreeView>
                                       
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" ontabclick="RadTabStrip1_TabClick"></telerik:RadTabStrip>
    <iframe  id="ContentIframe4" width=100% height="600px" frameborder="0" runat="server"></iframe>

    C#

    protected void TreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
    ... database retrieve of sScreebnPath (url), stabname based on node click

           RadTab rtNewTab = new RadTab () ; 
    RadTabStrip1.Tabs.Add(rtNewTab);
           rtNewTab.Text = sTabName; 
           rtNewTab.Attributes["url"] = sScreenPath;
           ContentIframe4.Attributes["src"] = sScreenPath;
    }

    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
    {
          ContentIframe4.Attributes["src"] = e.Tab.Attributes["Url"]; 
    }
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 06 Jul 2011 Link to this post

    Hello Daniel,

    The reason for the experienced behavior is due to the fact that when you dynamically add controls, you should add them upon every post-back in order their state to be persisted. Since you add you tabs on node click only, upon next post-back their state will be lost unless you add them again.

    Regards,
    Dimitar Terziev
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel
    Daniel avatar
    5 posts
    Member since:
    Mar 2011

    Posted 12 Jul 2011 Link to this post



    Hi,

    Thanks for the reply. Here is a strip down of the screen design. (actual project retrieves screen path from database)

    If you were to open page 1 and page 2 from the treeview, then key in something into the textbox, then open page3 from the treeview. and page 1 and page 2 entry will be lost. what method of control i need to implement to maintain them.

    This was previously done using YUI through client based javascript and iframe. Any help would be greatly appreciated :) 

     thanks. 

    p.s. i have submitted the code through support ticket
  5. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 14 Jul 2011 Link to this post

    Hi Daniel,

    I've already responded to your support ticket, so my suggestion is to continue the discussion there.

    Kind regards,
    Dimitar Terziev
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top