private void ExtendForAjax(TagMaker tag) { if (!String.IsNullOrEmpty(AjaxTarget)) { tag.MergeAttribute("data-ajax", "true"); tag.MergeAttribute("data-ajax-update", AjaxTarget); tag.MergeAttribute("data-ajax-method", AjaxMethod.ToStringValue()); tag.MergeAttribute("data-ajax-mode", AjaxMode.ToStringValue()); } }
public static string ToStringValue(this AjaxMode mode) { switch (mode) { case AjaxMode.Append: return("append"); case AjaxMode.Prepend: return("prepend"); case AjaxMode.Replace: return("replace"); case AjaxMode.InsertAfter: return("insertAfter"); case AjaxMode.InsertBefore: return("insertBefore"); default: return("replace"); } }