This is a migrated thread and some comments may be shown as answers.

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

3 Answers 70 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 01 Jul 2011, 08:04 AM
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"]; 
}

3 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 06 Jul 2011, 09:08 AM
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!

0
Daniel
Top achievements
Rank 1
answered on 12 Jul 2011, 08:03 AM


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
0
Dimitar Terziev
Telerik team
answered on 14 Jul 2011, 03:11 PM
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!

Tags
TabStrip
Asked by
Daniel
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or