<form>
<div>
<input for="IPMaquina" type="text" placeholder="IP da Máquina">
<button>Estado Máquina</button>
<button type="button" onclick="window.location.href='JCash_SubPages/VNEconfig';" style="text-decoration: none; color: black;">Configuração</button>
</div>
For some reason the onclick action won’t redirect to the VNEconfig View and leads to a 404 Error
If I move it to the same directory it works
however I don’t consider this a fix as there will be more Views and I’d like to organize it early on.
2
Answers
Are you missing out the exact path of the file along with its extension?
Perhaps you need to specify it as:
ASP.NET Core controllers use the Routing middleware to match the URLs of incoming requests and map them to actions.
The ASP.NET Core MVC template generates conventional routing code similar to the following:
The route template "{controller=Home}/{action=Index}/{id?}": Matches a URL path like /Products/Details/5
Extracts the route values { controller = Products, action = Details, id = 5 } by tokenizing the path.
The extraction of route values results in a match if the app has a controller named ProductsController and a Details action:
Read Routing to controller actions in ASP.NET Core to know more.
You can create an action in the Home controller , go to the VNEconfig action then to redirect JCash_SubPages/VNEconfig View:
Modify your code like: