ビジュアルベーシックを始めたばかりです
ポストバックが行うことasp:DropDownList
はAutoPostBack="true"
、選択に応じて別のドロップダウンリストを埋めることです。
最初のドロップダウン リストの選択を処理するコード ビハインドを次に示します。
Public Sub checklistDropMenuChange(sender As Object, e As System.EventArgs) Handles checklistDropMenu.SelectedIndexChanged
If (checklistDropMenu.SelectedValue = -1) Then
taskDropMenu.Items.Clear()
taskDropMenu.Enabled = False
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "KeepAddChecklistPopup", "showPopup('addChecklisTaskopup', 'add new Task');", True)
Else
taskDropMenu.Enabled = True
taskList.SelectParameters("lngChecklist").DefaultValue = checklistDropMenu.SelectedValue
taskDropMenu.Enabled = True
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "KeepAddChecklistPopup", "showPopup('addChecklisTaskopup', 'add new Task');", True)
End If
End Sub
フォームはポップアップ div にあります。ページを選択すると、ページにある 2 つを除くすべてのデータが空になりますDropDownLists
。
AutoPostBack="true"
最初のドロップダウンリストで thisngをfalse
選択すると、何もしないことに注意してください。
最初のドロップダウン選択に応じて 2 番目のドロップダウンリストを入力し、すべてのデータを保持するにはどうすればよいですか?