asp.net mvc 4 - Jquery Tabs MVC 4 - Redirect to to tab from controller -
i have following code 'selectedtabtofind' set in controller. used validation, correct tab displayed.
$("#tabs").tabs( { active: $("#selectedtabtofind").val(), cache: false }); <div id="tabs"> <ul> <li><a href="#tabs-1" title="view">view</a></li> <li><a href="#tabs-2" title="update">update</a></li> <li><a href="#tabs-3" title="validate">validate</a></li> <li><a href="#tabs-4" title="notes">notes</a></li> </ul> <div id="tabs-1"> @html.partial("view",model) </div> <div id="tabs-2"> @html.partial("update",model) </div> <div id="tabs-3"> @html.partial("validate",model.validatemodel) </div> <div id="tabs-4"> @html.partial("notes", model) </div>
view tab - displays information
update tab - can update information on tab
validate tab - can update information on tab
notes tab - displays list of information separate page outwith tabs add/update note
the validation works , displays correctly update , validate tabs. redirect not work when add/update note uses separate page outwith tabs.
i have used following code before redirect tab
return redirect(url.action("view", new { id = note.id }) + "#tabs-4");
and not work above code
if comment out 'active' works correctly
$("#tabs").tabs( { //active: $("#selectedtabtofind").val(), cache: false });
how redirect correct tab keep active option validation?
when redirectto tab, tab becomes automatically active. cannot , contrary!
from jquery tabs doc
active type: boolean or integer default: 0 panel open. multiple types supported:boolean: setting active false collapse panels. requires collapsible option true. integer: zero-based index of panel active (open). negative value selects panels going backward last panel.
Comments
Post a Comment