BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
I'm working on asp.net mvc, and using ORUBASE tools, in the first of all thanks for your
help
I have a question
I used in my home page orubase.tab
control , suppose home page named "index" , in index page there is three tabs
Home :that use LoadAjaxContent(Url.Content(home))
About : that use LoadAjaxContent(Url.Content(about))
Contacts : that use LoadAjaxContent(Url.Content(contacts))
And in each page has some links to another pages , in the child
pages there is back button that return to specific parent tab
I can write code to return to index page, but I can't return to
specific tab in index page
Can you help me please
Thanks and regards
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.