Answer the question
In order to leave comments, you need to log in
How to load partial view automatically after page load?
The user clicks on
<td>@Html.ActionLink("Редактировать","Studedit", new {id=s.ID })</td>
@using (Html.BeginForm("Studedit", "Praktika", FormMethod.Post))
{
<fieldset>
@Html.HiddenFor(m => m.ID)
<p>@Html.LabelFor(m => m.FAM, "Фамилия:")</p>
<br />
@Html.EditorFor(m => m.FAM)
<br />
<p>@Html.LabelFor(m => m.IM, "Имя:")</p>
<br />
@Html.EditorFor(m => m.IM)
<br />
<p>@Html.LabelFor(m => m.OTC, "Имя:")</p>
<br />
@Html.EditorFor(m => m.OTC)<br />
<p><input type="submit" value="SAVE" /></p>
</fieldset>
}
<hr />
<div id="divsostav">
</div>
<script type="text/javascript">
$(function () {
$.ajaxSetup({ cache: false });
$('#sostav').click(function (e) {
e.preventDefault();
$('#divsostav').load('@Url.Action("Sostav", "Praktika")')
});
});
</script>
<script type="text/javascript">
$(function () {
$.ajaxSetup({ cache: false });
$.load(function (e) {
e.preventDefault();
$('#divsostav').load('@Url.Action("Sostav", "Praktika")')
});
});
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question