MVC DropDownList SelectedValue not displaying correctly

后端 未结 7 959
甜味超标
甜味超标 2020-12-01 12:40

I tried searching and didn\'t find anything that fixed my problem. I have a DropDownList on a Razor view that will not show the the item that I have marked as Selected in th

7条回答
  •  广开言路
    2020-12-01 12:50

    Make Sure that your return Selection Value is a String and not and int when you declare it in your model.

    Example:

    public class MyModel
    {
        public string StatusID { get; set; }
    }
    

提交回复
热议问题