We are developing using the new Razor syntax. I have the top part of the page in C#. I have the rest of the page in HTML. My page extension is a CSHTML file.
We have a normal HTML dropdown:
And I'm storing the value of FoodName to a variable in C#:
FoodSelection = Request["FoodName"];
Now I can put that selection into the Database and pull it back out and set it to my FoodSelection variable, but I can't figure out how to select the proper dropdown for the user to see.
For a textbox, it's easy, I just set the value to "@FoodSelection" so it looks like this:
<value = "@FoodSelection" />
But how can I do this for a Dropdown box?
I hope my question is easy enough.