-2
我有一些DropdownLists在我看來通過AJAX成功更新<select>
這裏是代碼
@Html.DropDownList("Question1", null, "Вопрос 1", htmlAttributes: new {@class = "form-control", @style = "height:40px;margin-bottom: 20px;"})
我有AJAX調用補充問題
這裏是代碼
<script>
$(document).ready(function() {
$('#save_quest').click(function() {
savequestion();
});
});
// Сохранение вопроса в модальном окне
function savequestion() {
$.ajax({
type: 'Post',
dataType: 'Json',
data: {
Question_new: $('#question').val(),
Answer: $('#answer').val(),
Preparing: $('#prepare').val(),
Retries: $('#retries').val(),
},
url: '@Url.Action("CreateNewQuestion", "Questions")',
success: function (da) {
if (da.Result === "Success") {
$('#myModal').hide();
emails_update();
} else {
alert('Error' + da.Message);
}
},
error: function (da) {
alert('Error');
}
});
}
如何在成功更新DropDownList值?
感謝對幫助
Update DropDown to what? – User3250
值DropdownList @ User3250 –
成功後您是否獲得新的列表數據? – User3250