Hi Yara,
Thanks for your
interest in Orubase product.
You can make your
desired tab to be active by means of “SelectedItemIndex”
property. Please follow the below code snippets.
1.Controller – Here we
have stored the selected item index value in one session variable and sent to
the view page
public ActionResult
Index()
{
ViewData["index"] =
Session["selectedindex"] ?? 0;
return View();
}
2.Index Page – In
this the SelectedItemIndex property will set the value got from the controller
@Html.Orubase().Tab("lbCore").SelectedItemIndex((int)ViewData["Index"]).Items(items =>
{
items.Add().Text("Home").LoadAjaxContent("Home", "Home").ImageUrl("/images/Normal.png").ActiveImageUrl("/images/Active.png");
items.Add().Text("About").LoadAjaxContent("About", "Home").ImageUrl("/images/Normal.png").ActiveImageUrl("/images/Active.png");
items.Add().Text("Contacts").LoadAjaxContent("Contacts", "Home").ImageUrl("/images/Normal.png").ActiveImageUrl("/images/Active.png");
})
3.About
Page – While clicking list item we have performed reload action. Hence while
reloading the page that we have set the Index value as current tab index(value
1) and returned to the view page so that it will make the tab item be active
with the returned value
//ViewPage
@{
Html.Orubase().ListBox("list1").OnItemSelect("Select").Items(itemm =>
{
itemm.Add().Text("Item21");
itemm.Add().Text("Item22");
itemm.Add().Text("Item23");
itemm.Add().Text("Item24");
itemm.Add().Text("Item25");
}).Render();
}
//Controller
public ActionResult About()
{
Session["selectedindex"]
= 1;
return
PartialView();
}
//Script
section
<script type="text/javascript">
function
Select() {
location.reload();
}
</script>
We
have also created the sample and attached here.
Please
go through the sample and get back to us if it helps out.
Regards,
Thivya.
DemoWeb_30e671db.zip