我不知道这里发生了什么,因为我知道该代码正在工作。我唯一确定知道的项目更改是对jQuery 3.31的升级。我在模式中的UpdatePanel中有2个下拉列表。第一个列表按预期填充。第二个下拉列表应该填充第一个的OnSelectedIndexChanged事件。事件正在触发,返回了5条记录,但下拉列表为空白。
更新在TFS中查看以前的版本后,这确实发生在升级到jQuery 3.31之后。
这是模式代码:
Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
If e.RowIndex <> -1 AndAlso e.ColumnIndex = 3 Then
MessageBox.Show(DataGridView1.Rows.Item(e.RowIndex).Cells(e.ColumnIndex).Value.ToString)
End If
End Sub
Private Sub DataGridView1_CurrentCellDirtyStateChanged(sender As Object, e As EventArgs) Handles DataGridView1.CurrentCellDirtyStateChanged
If DataGridView1.CurrentCell IsNot Nothing AndAlso DataGridView1.CurrentCell.ColumnIndex = 3 Then
DataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
End Sub
这是事件处理程序:
<div id="modalTicketReportSelect" class="md-modal colored-header custom-width md-effect-9 primary">
<div class="md-content">
<div class="modal-header">
<button type="button" data-dismiss="modal" aria-hidden="true" class="close md-close"><i class="icon s7-close"></i></button>
<h3 class="modal-title">Ticket Type Report</h3>
</div>
<div class="modal-body form">
<div class="panel panel-alt3 panel-transparent">
<div class="panel-heading panel-heading-cg">
<button runat="server" id="btnAddToGrid" type="button" class="btn btn-alt3" data-dismiss="modal" onserverclick="btnAddToGrid_ServerClick" ><i class="icon s7-check"></i> Save</button>
<button type="button" data-dismiss="modal" class="btn btn-alt3 md-close"><i class="icon s7-close"></i> Cancel</button>
</div>
</div>
<asp:UpdatePanel runat="server" UpdateMode="Always">
<ContentTemplate>
<div class="form-group">
<label class="text-danger">Ticket Type</label>
<asp:DropDownList ID="ddlTicketTypes" runat="server" CssClass="form-control" AutoPostBack="true" OnSelectedIndexChanged="ddlTicketTypes_SelectedIndexChanged"></asp:DropDownList>
</div>
<div class="form-group">
<label class="text-danger">Ticket Report</label>
<asp:DropDownList ID="ddlTicketReport" runat="server" CssClass="form-control" ></asp:DropDownList>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
Dev工具不会在页面上显示任何错误。我很沮丧!非常感谢您的协助。