我已經鑑於下拉列表由Viewbag從控制器綁定爲以下「全部」選項: ViewBag.test = from p in _userRegisterViewModel.GetEmpPrimary().ToList().Where(a => a.UserType_id != Convert.ToInt32(Session["loginUserType"].ToString()))
我在綁定MVC中的下拉列表時遇到問題。我的代碼如下。 型號: public class CommentDateLayer
{
SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["BlogContext"].ToString());
public int AddEmpl