TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Muhammad Shaikh
NA
46
1.2k
How to execute the API and then redirect to some other page in project
May 10 2021 9:46 AM
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> *@
Reply
Answers (
1
)
How to open external website and get its html content in asp.net
i want to upload multiple image and some form data to sql in web api