Ich habe ein Formular, das im Update-Panel ist und mit Bootstrap-Modal auslöst. Und ich habe eine Kaskadierungsliste. Wenn zuerst DropDownList
geändert wird, sollte DropDownList
geladen werden. Aber Seite neu laden nach ersten DropDownList
geändert.C# DropDownList selectedindexexchanged in updatepanel mit bootstrap modal
<asp:UpdatePanel ID="updPanel1" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<div class="modal fade" tabindex="-1" role="dialog" id="yenitalep">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Form</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="envanter">Tip</label>
<asp:DropDownList ID="ddlTip" runat="server" CssClass="form-control" OnSelectedIndexChanged="ddlTip_SelectedIndexChanged"></asp:DropDownList>
</div>
<div class="form-group">
<asp:DropDownList ID="ddlTip1" runat="server" CssClass="form-control level1"></asp:DropDownList>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlTip" />
</Triggers>
</asp:UpdatePanel>
C# -Code hinter:
protected void ddlTip_SelectedIndexChanged(object sender, EventArgs e)
{
short id = short.Parse(ddlTip.SelectedValue);
List<servisTipleri> list = ServisTipController.childs(id);
ddlTip1.DataSource = list;
ddlTip1.DataTextField = "title";
ddlTip1.DataValueField = "id";
ddlTip1.DataBind();
}
Wie kann ich lade zweiten DDL ohne Seite erfrischend.
sind Sie in der Lage Wert von 2. Dropdownlist zu bekommen? weil Sie Ihr Ereignis nicht ausgelöst haben, dh AutoPostBack = "true" von 1. Dropdown –