I have a page with 5 tabs on it, containing fields that the user fills out. I would like to save the data from each tab as the user navigates between tabs (postback). What is the best way to do this? I have tried javascript (no postback here) and using a case statement triggered by a case statement. In the second method, for some reason the navigation does not occur and the data is cleared on the button click.
JavaScript method:
$(function () {
$("#<%= btnBack.ClientID%>").css("display", "none");
$("#<%= btnNext.ClientID%>").click(function (event) {
$("#tabIncident").tabs("option", "active", $("#tabIncident .ui-tabs-active").index() + 1);
});
$("#<%= btnBack.ClientID%>").click(function (event) {
$("#tabIncident").tabs("option", "active", $("#tabIncident .ui-tabs-active").index() - 1);
});
C# Case Statement Method:
switch (e.CommandName)
{
case "BACK":
if (_eventID == 0)
{
Save(false, Mode.Edit, Status.Save);
RedirectTo(pageLocation - 1);
}
else
Update(_eventID, false, Status.Save);
RedirectTo(pageLocation - 1);
break;
case "NEXT":
if (_eventID == 0)
{
Save(false, Mode.Edit, Status.Save);
RedirectTo(pageLocation + 1);
}
else
Update(_eventID, false, Status.Save);
RedirectTo(pageLocation + 1);
break;