asp.net fixed select options

asp.net fixed select options

montoyammontoyam Posts: 568Questions: 136Answers: 5

The only example I can find for select box options is to pull from a database. I have one where 1 = "Dept. Total", 2="Fixed Rate" and I don't need a table for this. How do I create this option list?

Answers

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921
    edited February 2020

    Is this for the Editor? If so I think you are looking for field().update().

    Kevin

  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    yes,for editor, but asp.net MVC. I don't see .update() unless I am looking in the wrong place.

  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    oh, looks like I didn't scroll down enough in the documentation...

    new Field("users.site")
        .Options( () => new List<Dictionary<string, object>>{
            new Dictionary<string, object>{ {"value", "EDI"}, {"label", "Edinburgh"} },
            new Dictionary<string, object>{ {"value", "LON"}, {"label", "London"} },
            new Dictionary<string, object>{ {"value", "NEW"}, {"label", "New York"} },
            new Dictionary<string, object>{ {"value", "SAN"}, {"label", "San Francisco"} }
        } );
    
This discussion has been closed.