TabStrip - Persisting RadTabStrip

5 posts, 0 answers
  1. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 12 Mar 2014 Link to this post

    Hello

    I add programmaticaly Tab on my TabStrip,
    but if the user Refresh the WebPage, i loose My TabStrip and Multipage.

    It's possible to Save Tab and Multipage when the user press F5 ?

    this sample can  help or not ? : http://demos.telerik.com/aspnet-ajax/tabstrip/examples/application-scenarios/persisting-tabstrip-settings/defaultcs.aspx

    Cause the restore not work , for Multipage.

    thanks for your help
    Olivier,
  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 17 Mar 2014 Link to this post

    Hi Oliver,

    PersistenceFramework doesn't support MulitiPage. Here is a complete list of all controls which can be used with PersistenceFramework.

    You should be able to save the selected index of MultipageView  manually. Detect F5 pressing on the client with javascript and use a hidden field as a boolean flag to determine later in the server's Page_Load event if the page was refreshed.
    <asp:HiddenField ID="isF5Pressed" runat="server" />


    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack && (isF5Pressed.Value == "True"))
        {
          //Store multipage's selected index in a session for example
        }
    }

    or you just can disable page refreshing with F5 as shown here.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 17 Mar 2014 in reply to Hristo Valyavicharski Link to this post

    Hello and thanks for your reply.

    i found an other solution , i store all the page and parameters in hidden field,
    to restore the RabTab when the user press F5.

    Or if i can detect F5 to refresh only a iFrame on tab selected.

    What do you think ?

    olivier
  5. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 20 Mar 2014 Link to this post

    Hi Oliver,

    This could be working. Try with the following code:

    <script language="javascript" type="text/javascript">
        function disableF5(e) {
            if ((e.which || e.keyCode) == 116)
            {
                e.preventDefault();
                var multipage = $find('RadMultiPage1');
                multipage.get_pageViews().getPageView(0).set_contentUrl("http://www.telerik.com");
            }
        };
     
        $(document).on("keydown", disableF5);
    </script>


    Regards,
    Hristo Valyavicharski
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  6. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 20 Mar 2014 Link to this post

    thanks i will test this.

    Olivier
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017