Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • adrian 8 posts 39 karma points
    Nov 06, 2014 @ 10:43
    adrian
    0

    Rendering macros and partial views with anonymous/various objects parameters

    Hi

    I'd like to render macro with dynamic/anonymous argument which can have difference type depends on using. Mostly these types can't be selected from available types of macro arguments so please for help how can I do that, and how can I access this object inside macro.

    @Umbraco.RenderMacro("RightLinks", <some object>);
    

    The similar solution will be very helpful for me when render partial views, where argument and Model in partial view is dynamic.

    @Html.Partial("subscribe", <some object>);
    

    I tried solutions from other posts in this forum, but nothing works for me.

    Please for Help, Adrian

  • Charles Afford 1163 posts 1709 karma points
    Nov 14, 2014 @ 13:27
    Charles Afford
    0

    Hi, What you need is IOC using something like unity? Do you have pluralsight?

    I am can give you a basic idea if you like :).

    Basically what you will end up with is being able to pass any model to your view / partial view that inherits from the interface you have specified in the config.

    Charlie

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies