It's not called MVC 6 anymore. It's now ASP.NET Core 1.0. The runat="server" is not used in ASP.NET Core 1.0 since it does not support web forms but instead relied on the MVC paradigm. For the same reason there is no onclick attribute either.
So you button might look like:
<button type="submit" class="btn btn-default">Click Here</button>
And the action method on the controller might look like:
[HttpPost]
public IActionResult Post() {
/*do work here*/
return View();
}
Full Example
In the comments you asked for an example of how one can tell which button was clicked if there were multiple buttons on the form. Here is an example:
/Views/example/index.cshtml
<html>
<body>
<form asp-controller="example" asp-action="Index">
<label>Value:</label><input name="someValue" type="text" maxlength="10" />
<button name="btnOne" type="submit" class="btn btn-default">Click One</button>
<button name="btnTwo" type="submit" class="btn btn-default">Click Two</button>
</form>
</body>
</html>
/Controllers/example/ExampleController.cs
using Microsoft.AspNetCore.Mvc;
namespace App.Web.Controllers {
public class ExampleController: Controller {
public ExampleController() {
}
[HttpGet]
[Route("/example/")]
public IActionResult Index() {
return View();
}
[HttpPost]
[Route("/example/")]
public IActionResult Index(string someValue) {
string buttonClicked = "";
if(HttpContext.Request.Form.ContainsKey("btnOne")) {
buttonClicked = "btnOne";
} else if(HttpContext.Request.Form.ContainsKey("btnTwo")) {
buttonClicked = "btnTwo";
}
return View("Index");
}
}
}
You can learn more about forms in ASP.NET Core here: https://learn.microsoft.com/en-us/aspnet/core/mvc/views/working-with-forms
They are amazingly flexible compared to webforms but the learning curve is a bit steeper at first.