0

I have multiple ActionLinks defined in the Index View of my MainController.

Html.ActionLink("admin",controller = "Admin",action = “Index”)
Html.ActionLink("customer",controller = "Customer",action = “Index”)
Html.ActionLink("billing",controller = "Billing",action = “Index”)

Those Actionlinks are inside the Jquery accordion control. When I click an actionlink which inside of an expander`s content the related view is rendered on the right contentDIV BUT on the left side the accordion has collapsed the formerly opened content pane and has expanded the initial content pane. Why is that or how can I prevent that?

Pravin Pawar
  • 2,559
  • 3
  • 34
  • 40
Pascal
  • 12,265
  • 25
  • 103
  • 195

1 Answers1

0

You can follow with the 2 options:

  1. Ajax loading of the page - you need to load your page content with ajax query and do not reload page. It will allow you to keep accordion expanded on right item.

  2. You need to open right item in accordion on the $(document).ready()... Because it will reload page state of the accordion will be refreshed and you need manually define whitch item should be opened. FOr example you can refere to the link:

    if (url == 'admin')
        openAccordionItem(1);
    if (url == 'Customer')
        openAccordionItem(2);
    if (url == 'Billing')
        openAccordionItem(3);
    
Samich
  • 29,157
  • 6
  • 68
  • 77