我在asp.net项目中使用ac#,它有一个选项卡,在其中我像在项目的其他部分一样添加了2个下拉框,当我运行调试时,我看到两个下拉框都显示了,并且它们显示数据库中项目应显示的空间,但为空白,因此它们正在从数据库中读取,我知道这是因为其中一个表应显示项目的原因我从SQL输入了12行,而对于另一个我又添加了一行只是,并且我发现每个空格的空白是根据每个表中记录的数量来增加或减少的。
This is in project.js
//LOAD ALL PICKLISTS.
function loadSavingsType() {
$.ajax({
type: "post",
url: fwRootUrl + "/services/BORAN.asmx/loadProjectDetailsPicklist",
dataType: "json",
//data: JSON.stringify({ Ext: ext, Name: name, Date: dateJoined, Role: role, Department: department, Education: objEducation, Work: objWork, Interest: objInterest }),
contentType: "application/json; charset=utf-8",
success: function (response) {
var picklist = JSON.parse(response.d);
var $dropdown = "";
//STATUS.
$dropdown = $("#selectStatus");
$dropdown.append($("<option />").val(" ").text(" "));
$.each(picklist.Status, function (key, value) {
$dropdown.append($("<option />").val(value.STATUS).text(value.STATUS));
});
//SMO
$dropdown = $("#selectSmo");
$dropdown.append($("<option />").val(" ").text(" "));
$.each(picklist.Smo, function (key, value) {
$dropdown.append($("<option />").val(value.Smo).text(value.Smo));
});
//PLANT
$dropdown = $("#selectPlant");
$dropdown.append($("<option />").val(" ").text(" "));
$.each(picklist.Plant, function (key, value) {
$dropdown.append($("<option />").val(value.Plant).text(value.Plant));
});
//CFR. <== This is the one of those with the problem
$dropdown = $("#selectCfr");
$dropdown.append($("<option />").val(" ").text(" "));
$.each(picklist.Cfr, function (key, value) {
$dropdown.append($("<option />").val(value.Cfr).text(value.Cfr));
});
//GAP. <== This is the one of those with the problem
$dropdown = $("#selectIws");
$dropdown.append($("<option />").val(" ").text(" "));
$.each(picklist.Iws, function (key, value) {
$dropdown.append($("<option />").val(value.Iws).text(value.Iws));
});
//FORMAT STATUS.
$dropdown = $("#selectFormatStatus");
$dropdown.append($("<option />").val(" ").text(" "));
$.each(picklist.Status, function (key, value) {
$dropdown.append($("<option />").val(value.STATUS).text(value.STATUS));
});
//FORMAT APPROVER.
$dropdown = $("#selectFormatApprover");
$dropdown.append($("<option />").val(" ").text(" "));
$.each(picklist.Approvers, function (key, value) {
$dropdown.append($("<option />").val(value.USERNAME).text(value.USERNAME));
});
这是在project.aspx本身中
<!--ADDING DROPDOWNS LISTS FOR CFR ROOT CAUSE AND IWS PILLAR-->
<div class="col col-md-6">
<%--<div class="pick-cause">--%>
<label for="selectCfr" class="col col-md-3 control-label">CFR ROOT CAUSE:
</label>
<div class="col-md-9">
<select id="selectCfr" class="form-controlt">
</select>
</div>
</div>
</div>
<div class="col col-md-6">
<%--<div class="pick-cause">--%>
<label for="selectIws" class="col col-md-3 control-label">GAP IWS PILLAR:</label>
<div class="col-md-9">
<select id="selectIws" class="form-controlt">
</select>
</div>
</div>
</div>
这是在BORA.asmx.cs
中DataTable dtCfr = ("SELECT DISTINCT CFR FROM tbl_Maint_CFRS").fwSqlFillDataTable();
DataTable dtIws = ("SELECT DISTINCT GAP FROM tbl_Maint_GAPS").fwSqlFillDataTable();
即使在没有运气的另一个开发环境中也尝试了一切。
非常诚实的感谢,非常感谢您的帮助