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?

Please Sign in or register to post replies

Write your reply to:

Draft