I am stuck in a problem, whenever I submit, it is going to a blank page to execute api.
I want, it should execute API and then redirected to another page.
How can I do that,
My cshtml code is below
- @model CourseGamePlay.Dtos.StudentsDTO
- @{
- ViewBag.Title = "Admin Panel - Weeks";
- Layout = "~/Views/Shared/_adminLayout.cshtml";
- }
-
- <h2>LOGIN</h2>
- <body>
- <form method="post" action="/api/studentlogin">
- <div class="form-horizontal">
- <div class="form-group">
- @Html.LabelFor(s => s.name, htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-4">
- @Html.EditorFor(s => s.name, new { htmlAttributes = new { @class = "form-control" } })
- @Html.ValidationMessageFor(s => s.name, "", new { @class = "text-danger" })
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-offset-2 col-md-15">
- <input type="submit" value="Login" class="btn btn-primary"/>
- </div>
- </div>
- </div>
- </form>
- </body>
- @* <script>
- $(function(){
- $("#redirect").click(function (e) {
- e.preventDefault();
- document.location = '@Url.Action("Week","Home")';
- });
- });
- </script> *@