We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Open specific tab when reload page

Hello,

I'm in the following situation:

- I have page 1 with a TAB control and TAB1, TAB2 and TAB3.
- The default opened tab is TAB1
- Each tab has got a grid. Clicking on the row of TAB2 grid, a page 2 will be opened
- On page 2 there is a back button
- When page 1 is reopened, I would like to see TAB2 opened (that is the tab containing the grid that triggered the opening of page2). Instead (obviously) page 1 is realoaded with TAB1 opened.

How can I "memorize" the tab to open in case of page reload?

Thanks.

Claudio

3 Replies

KV Karthikeyan Viswanathan Syncfusion Team May 5, 2017 11:34 AM UTC

Hi Claudio,   
   
Thanks for contacting Syncfusion support.   
   
Yes, you can maintain a last selected tab item state using enablePersistence property.   
   
Please refer the code snippet:   
   
<code>   
   
@{Html.EJ().Tab("defaultTabs").EnablePersistence(true).Items(data =>   
           {   
               data.Add().ID("steelman").Text("Man of Steel").ContentTemplate(@<div>   
                      
                                       A young boy learns that he has extraordinary powers and is not of this Earth.   
               </div>);   
           }).Render();}   
</code>   
   
   
MVC Sample Browser sample linkhttp://mvc.syncfusion.com/demos/web/tab/statemaintenance    
   
   
Regards,   
Karthikeyan V.  
 



CR CLAUDIO RICCARDI May 5, 2017 02:00 PM UTC

Ok. It works!

Thank you!

Claudio


KV Karthikeyan Viswanathan Syncfusion Team May 8, 2017 04:04 AM UTC

Hi Claudio,   
 
Thanks for the update.  
 
We are glad the suggestion helped you to achieve your requirement.  
 
Please let us know if you need further assistance.  
 
Regards,   
Karthikeyan V. 


Loader.
Live Chat Icon For mobile
Up arrow icon