I have this button on about a dozen of my pages:
<button type="button" class="btn btn-outline-primary btn-back" onclick="location.href='/Controller/Action'">Button text</button>
The text of the button will change along with the link but everything else should be the same. Some options I'm thinking about doing are:
- Just writing the html ~12 times.
- Putting something like this in my _layout page:
@if (ViewBag.Button != null) {<button type="button" class="btn btn-outline-primary btn-back" onclick="location.href='@ViewBag.ButtonLink'">@ViewBag.Button</button> }
3. Creating a custom tag helper for it
4. ???
What would you do?