0

I have this piece of cshtml code i'm trying to use to default to a particular state in the United states. Thanks in advance.

<label class="dnnLabel">@Localization.GetString("State"):</label>
<select id="@(Model.Prefix + "state")" name="@(Model.Prefix + "state")" tabindex="@(Model.TabIndex + 8)" ></select>
<input type="hidden" id="@(Model.Prefix + "tempregion")" value="@Model.Address.RegionBvin" />
Ziv Weissman
  • 4,250
  • 3
  • 27
  • 57
Eric R
  • 1
  • Possible [duplicate](https://stackoverflow.com/questions/3518002/how-can-i-set-the-default-value-for-an-html-select-element) – FortyTwo May 23 '17 at 19:56

1 Answers1

0

This question has already been answered here. Have the attribute selected set to 'selected' like so:

<option selected="selected">
TheSelectedOption
</option>

Hope this helped.

Ethan Coe
  • 47
  • 4