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
Jefferson S. Motta
90
20.5k
780.8k
Blazor, call Server Side Controller from .razor page
Feb 7 2020 3:44 PM
I'm using Blazor, the last preview:
On razor page, I'm trying using:
await Http.PostJsonAsync("api/ValuesController", addItem);
This is my Controller:
[Route("api/Controller")]
public class ValuesController : Controller
// POST api/<controller>
[HttpPost]
public void Post([FromBody]WeatherForecast value)
{
value.MyMethod();
I'm registering on server:
app.UseEndpoints(endpoints =>
{
endpoints.MapDefaultControllerRoute();
endpoints.MapFallbackToClientSideBlazor<Client.Program>("index.html");
endpoints.MapControllerRoute(name: "DefaultApi", pattern: "api/{controller}");
});
}
But here is occurring error 404: await Http.PostJsonAsync("api/ValuesController", addItem);
What Am I missing?
Reply
Answers (
0
)
Problems finding which process throws ‘Unexpected exception’
C# Listview/Datagridview columns names contain date and day