Closed angelocarlotto closed 9 years ago
What kind of html output are you looking for? And why do you need this?
I have severals tabs, and some of it i need when i click in it, it will make a request into an action and render its contents in the target div. I would like to create something like a component.
in the .cshtml, some thing like @using (var tabs = Html.Bootstrap().Begin(new Tabs())) { @tabs.Tab("Tab One","TabOne").Class("ClickableTabRequest").Data(new{ActionUrl=Url.Action("GetProfile","User"), IdClient=Model.IdCliente}) using (Html.BeginForm()) { using (tabs.BeginPanel()) {
}
}
In the .js file, something like
$(document).on("click",".ClickableTabRequest",function(){ var tab=$(this); $.post(tab.data("actionurl"),tab.data(),function(data){
$(tab.attr("href")).html(data);
});
})
Hope i made my self explained.
Thanks
Added requested methods. Please get latest.
Would be possible to Tabs has Data and HtmlAtributes methods?
@using (var tabs = Html.Bootstrap().Begin(new Tabs("TabId1"))) { @tabs.Tab("Tab One","TabOne",new {@class="testeClassCSS"}).Data(new{idCliente=Model.IdCliente}).Class("TabMainClienteCSSClass") using (Html.BeginForm()) { using (tabs.BeginPanel().Data(new{idCliente=Model.IdCliente}).Class("SubTabClienteCSSClass")) {
}