Copied to clipboard

Flag this post as spam?

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


  • Stephanie Nicolaou 33 posts 91 karma points
    Mar 21, 2015 @ 11:56
    Stephanie Nicolaou
    0

    Dropdown list items in asp form

    Hi all,

    I have an asp form in a web form template linked to a masterpage I created and I would like the dropdown values to be razor navigation page names / properties.

    I can insert a macro to retrieve the page names I want in a list, e.g.:

    [code]<umbraco:Macro  runat="server" language="cshtml">                               
                                        @{
                                            @* Get the root of the website *@
                                            var root = Model.AncestorOrSelf(1);
                                        }

        @foreach (var page in root.Children.Where("Visible"))
                                            {
                                               
                                                <li class="menu">
                                                    <a href="@page.Url">@page.Name</a>
                                                </li>

                                            }[/code]

    However is it possible to do something like this within the asp dropdown tags?

  • 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