Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I navigate to a new page with a Button in ASP.net Core?

I've got a webpage that currently links to another page like this:

<a asp-action="Create">Create New</a>

I've tried this and it just sat on the page very happily, but didn't take me where I want to go:

<button asp-action="Create" class="btn btn-primary">Create</button>

How can I change this to use a button instead of a text link?

like image 794
Adam Wells Avatar asked Dec 05 '22 12:12

Adam Wells


1 Answers

This should work:

<a asp-action="Create"><button class="btn btn-primary">Create</button></a>
like image 127
Oluwafemi Avatar answered May 14 '23 05:05

Oluwafemi