我正在尝试将表单值发回给控制器。但是在操作中,我将ViewModel作为null。这是ViewModel
public class CommunicationDetailsViewModel
{
public string OrganizationName { get; set; }
public List<Country> Country { get; set; }
public List<State> State { get; set; }
public List<City> City { get; set; }
当某些特定情况发生变化时,我试图填充下拉列表。在所有案件中,99%的情况都很好。但是,偶尔,我在生产服务器上会出现这样的错误:
Exception of type 'System.Web.HttpUnhandledException' was thrown.; 'ddlNCE' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value;
我们无法在我们的开发环境中复制这一点。这是调用堆栈:
at System
很难让这个dropDownList绑定。这是一个简单的州清单。Model.State是"TX",但我的下拉列表显示"AK",这是列表中的第一个值。有什么想法吗?
<%: Html.DropDownListFor(
model => model.State,
new SelectList(
muniSynd.getStatecodesDropDown(),
我在gridview中有一个下拉列表,它通过web方法获取数据,但保存数据后,我无法在gridview中显示保存的数据。
下面是通过web方法绑定gridview的代码:
Private Sub BindData()
Dim objTable As New DataTable("ProjectInfoClass")
objTable = objWebService.BindProjectInfo
projectInfoList.Clear()
For Each dr As DataRow In objTable.Rows
pr