本文介绍了UpdatePanel内部的下拉样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在updatepanel中有2个下拉列表,当我从下拉列表中选择一个项目时,另一个列表根据另一个ddl更改。
这是我的aspx代码
Hi,
I have 2 dropdownlist within the updatepanel when I select a item from dropdownlist another list change according to another ddl.
This is my aspx code
<asp:UpdatePanel runat="server" ID="pnlModalFirst" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-body">
<asp:DropDownList runat="server" CssClass="selectpicker markaselect margin-bottom-10" ID="ddlBrand" ClientIDMode="Static" DataValueField="Id" DataTextField="BrandName" AutoPostBack="True" OnSelectedIndexChanged="ddlBrand_SelectedIndexChanged" title="Marka Seçiniz" data-live-search="true" />
<asp:DropDownList runat="server" CssClass="selectpicker modelselect margin-bottom-10" ID="ddlModel" ClientIDMode="Static" AutoPostBack="True" OnSelectedIndexChanged="ddlModel_SelectedIndexChanged" title='Model Seçiniz' />
<asp:DropDownList runat="server" CssClass="hidden selectpicker margin-bottom-10" ID="ddlKaroser" title='Karoser Seçiniz' />
<asp:Button runat="server" CssClass="col-md-2 btn-block btn-u btn-u-blue btn-u-lg " ID="btnDKnow" Text="Teklifleri Al" OnClick="btnDKnow_Click" ValidationGroup="modalKnow" />
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlBrand" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="ddlModel" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
我还使用 []插件我的下拉列表但是当我改变第一个ddl所有风格都像这样打破
之前选择ddl
[]
选择ddl后
[]
您有什么建议。
And also I use [this] plugin my dropdownlist but when I change first ddl all style broken like this
Before select ddl
http://imgur.com/GwKY8wg[^]
After select ddl
http://imgur.com/Zqhev2e[^]
Do you have any suggestion.
推荐答案
ScriptManager.RegisterStartupScript
你必须在页面加载中注册JS
You have to register JS in page load
这篇关于UpdatePanel内部的下拉样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!