Hi. I would like to know if there is any way to delay a clicked tab from displaying until my corresponding MVC controller action is completed? The following code below calls an MVC controller "Controller" with the ActionResult "ControllerAction" and "message" is the name of the tab I am displaying for validation.
Currently, I have a function called within the if statement if(a_tabPageSelected == "MyTab") which takes a while to complete and would prefer if the tab section didn't appear until the function completes.
Controller.cs
View.cshtml
Currently, I have a function called within the if statement if(a_tabPageSelected == "MyTab") which takes a while to complete and would prefer if the tab section didn't appear until the function completes.
Controller.cs
public
ActionResult ControllerAction(
string
a_tabPageSelected)
{
if
(a_tabPageSelected ==
"MyTab"
)
{
/// do stuff before tab page appears
}
/// now display tab page using some command and return View
return
View(
"Tabsection"
);
View.cshtml
function
onSelect(e) {
var
message = $(e.item).find(
"> .k-link"
).text();
$.get(
'/Controller/ControllerAction/?a_tabPageSelected='
+ message,
function
(data) {
$(
"#TabDiv"
).html(data);
});
}