In my view I am using buttons like this
<button style=" color:White; height:30px; width:100px; background-image: url('@Url.Content("~/Content/Images/RedButton.gif")');" name="button" value="Add" type="submit">Add</button>
<button style=" color:White; height:30px; width:100px; background-image: url('@Url.Content("~/Content/Images/RedButton.gif")');" name="button" value="Save" type="submit">Save</button>
<button style=" color:White; height:30px; width:100px; background-image: url('@Url.Content("~/Content/Images/RedButton.gif")');" name="button" value="Cancel" type="submit">Cancel</button>
and handling them in the controller like this
[HttpPost]
public ActionResult Index(BuildRegionModel model, string button)
{
if (button == "Add")
{
}
if (button == "Save")
{
}
if (button == "Cancel")
{
}
return View(model);
}
Is there a way that I can do something like this
<a href="#" onclick="javascript:location.href='@Url.Action("", "")'" class="RedButton">Add</a>
<a href="#" onclick="javascript:location.href='@Url.Action("", "")'" class="RedButton">Save</a>
<a href="#" onclick="javascript:location.href='@Url.Action("Home", "Index")'" class="RedButton">Cancel</a>