public ActionResult Button2_Click(int activeIndex) { int nextIndex = activeIndex + 1; if (nextIndex >= 3) { nextIndex = 0; } UIHelper.Accordion("Accordion1").ActivePaneIndex(nextIndex); return(UIHelper.Result()); }