Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.NET
<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>


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.
Posted
Updated 25-Mar-14 2:01am
v2
Comments
ammoti 25-Mar-14 11:31am    
Okey Now,
I use this function within page but that time page do postback every change option.
function __doPostBack(eventTarget, eventArgument) {theForm.submit(); $('.selectpicker').selectric('refresh'); } }
ZurdoDev 25-Mar-14 12:24pm    
You'll have to use your browser tools to see what's happening.
ammoti 25-Mar-14 14:11pm    
Actually , I use tools but I didn't see anything may be I can not use browser tools efficently

Thank you Ryan
ZurdoDev 25-Mar-14 14:20pm    
Glad to see you got it resolved.

1 solution

I solved this problem with that
ScriptManager.RegisterStartupScript
You have to register JS in page load
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900