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
Ronald Abellano
NA
161
37.3k
Pass model through RedirectToAction
Jun 30 2018 11:55 AM
Hi, how can we pass model to another page?
I'am using ASP.Net Core2.0
The data is passed in address bar but its not showing up in the model.
Controller
[HttpPost]
public IActionResult Error()
{
return RedirectToAction(nameof(ExceptionPageController.Index), "ExceptionPage", new ExceptionPageModel { ErrorMessage ="Hello World!"});
}
View
@model Webeu.Models.ExceptionPage.ExceptionPageModel
@{
ViewData["Title"] = "Index";
}
<form asp-controller="Account" asp-action="Error" method="get">
<p>form</p>
<p> @Html.DisplayNameFor(m => m.ErrorMessage)</p>
<p>arigato @Html.DisplayFor(m => m.ErrorMessage)</p>
</form>
Reply
Answers (
1
)
how to do Response.Redirect inside task
ASP.NET MVC5 Stored Procdure Output Error