我的 asp.net 网页中有一个下拉列表。它是一个服务器端控件。我正在做一个 ajax 调用,在 ajax 调用中我正在向 ddl 添加一个新项目并将其设置为选中状态。它在页面上显示得很好。但是当我回发时,所选项目会在下拉列表中为我提供旧的所选项目。
// ddlCaseNumber is the id of the dropdownlist and its clientid property is set
// to static.
// Removes the selected attribute of selected selected item .
$('#ddlCaseNumber option:selected').removeAttr("selected");
// Add the new item to dropdownlist.
$('#ddlCaseNumber').append('<option selected="selected" value=' + crmid + '>'
+ crmid + '</option>');
// Code behind code to get the new value.
// This line is giving the old value instead of giving new value.
string strNewValue = ddlCaseNumber.SelectedItem.Value;
谁能告诉我如何在后面的代码中添加新项目?
提前致谢。