Skip to content

Instantly share code, notes, and snippets.

@davemcdermid
davemcdermid / Spanchor
Last active January 27, 2016 17:38 — forked from anonymous/Spanchor
HtmlHelper extension to toggle between span & anchor easily
using System;
using System.Collections.Generic;
using System.IO;
using System.Web.Mvc;
public static class SpanchorExtension
{
public static Spanchor Spanchor(this HtmlHelper htmlHelper, bool useAnchor, string url, object htmlAttributes = null)
{
var tag = useAnchor ? "a" : "span";