I want to inject free api into my mvc sites. I got the basics. So, implement an object library, for example:
public class UIElement{} public class ButtonBase : UIElement{} public class LinkButton : ButtonBase {} public static class Extensions { public static T UIElementMethod<T>(this T element, string title) where T : UIElement { return element; } public static T ButtonBaseMethod<T>(this T element, string title) where T : ButtonBase { return element; } public static T LinkButtonMethod<T>(this T element, string title) where T : LinkButton { return element; } }
But how to use it in razor mode without calling the flush method.
@Html.UIproject().LinkButton() .UIElementMethod("asd") .ButtonBaseMethod("asd") .LinkButtonMethod("asd")
But it returns the name of the class. I tried to make an implicit statement for MvcHtmlString, but it did not call. Any idea how to achieve this. How to find out about the chain. I love the way the Kendo user interface works.
Thanks,
Peter
source share