I have used jquery ui tab effect. What I am trying is to insert data into a model..it works perfectly..I can insert record..but my question is how to stay on the same tab after insertion ?can I do it from the controller ? I am trying to do it in my asp.net mvc 3 application
Here goes my Tab calling portion:
<script>
$(function () {
$("#tabs").tabs();
});
</script>
<div id="tabs">
<ul>
<li><a href="#tabs-2">Proin dolor</a></li>
<li>@Html.ActionLink("Create Student","CreateStudent")</li>
<li>@Html.ActionLink("Student Details", "StudentDetails")</li>
</ul>
</div>
Here goes the student details tab:
@model IEnumerable<accordionNtabs.Models.student>
<table>
<tr>
<th>
name
</th>
<th>
birthdate
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.name)
</td>
<td>
@Html.DisplayFor(modelItem => item.birthdate)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.id }, new { id = "privacyLink" }) |
@Html.ActionLink("Details", "Details", new { id=item.id }) |
@Html.ActionLink("Delete", "Delete", new { id=item.id }) |
</td>
</tr>
}
</table>
Here goes the Edit view which is rendered on clicking on the Edit link:
@model accordionNtabs.Models.student
@using (Html.BeginForm()) { @Html.ValidationSummary(true) student
@Html.HiddenFor(model => model.id)
<div class="editor-label">
@Html.LabelFor(model => model.name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.name)
@Html.ValidationMessageFor(model => model.name)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.birthdate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.birthdate)
@Html.ValidationMessageFor(model => model.birthdate)
</div>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
}
@Html.ActionLink("Back to List", "Index")I want the edit view to be loaded on the same tab.
how to stay on same tabmean? Show your code and identify what part of code is causing problemsload in same tabmean?. Please put more effort into explaining what you are trying to do in more explicit terms. It is not clear if you have problems with your server code or with client code and what will trigger this loading