Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:UpdatePanel ID="UpdatePanelMain" runat="server" UpdateMode="Always"  >
                           <ContentTemplate>
  <asp:DropDownList ID="DrpEmployeeType"  CssClass="DropDownSlide"  runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlEmployeeAccessChange" >
                                <asp:ListItem>Choose one</asp:ListItem>
                                <asp:ListItem>Admin</asp:ListItem>
                                <asp:ListItem>Doctor</asp:ListItem>
                                <asp:ListItem>Nurse</asp:ListItem>
                            </asp:DropDownList>
    </ContentTemplate>
                        </asp:UpdatePanel>


the probelm is that when i put CssClass DropDownSlide on DropDownList SelectedindexChanged is not working. Note DropDownSlid is A jquery.
Thanks in Advance.
Posted
Updated 25-Apr-20 21:13pm
v2

Add Trigger To Your Update Panel

Like--

ASP.NET
 <asp:updatepanel id="UpdatePanelMain" runat="server" updatemode="Always">
                           <contenttemplate>
  <asp:dropdownlist id="DrpEmployeeType" cssclass="DropDownSlide" runat="server" autopostback="true" onselectedindexchanged="ddlEmployeeAccessChange">
                                <asp:listitem>Choose one</asp:listitem>
                                <asp:listitem>Admin</asp:listitem>
                                <asp:listitem>Doctor</asp:listitem>
                                <asp:listitem>Nurse</asp:listitem>
                            </asp:dropdownlist>
    </contenttemplate>
<triggers>
                                <asp:asyncpostbacktrigger controlid="DrpEmployeeType" eventname="SelectedIndexChanged" />
                                
                            </triggers>
                        </asp:updatepanel>
 
Share this answer
 
v4
Comments
Jawad Ahmed Tanoli 22-Nov-13 8:38am    
No it is not working i already do this it work fine without applying jquery.
__doPostBack('<%# DrpEmployeeType.ClientID %>', '')
By adding this code in jquery it now allow postback.
 
Share this answer
 
Comments
Member 12456028 13-Jun-17 1:26am    
Thank you Mr.Jawad
Can you please tell me where i add this code?
PS Solutions 13-Jun-17 19:05pm    
check my solution at the bottom of this page.
PS Solutions 13-Jun-17 18:36pm    
This code is constantly running postBack.
Alright I found the perfect solution. Please study this code and get back to me if you have any questions


<div class="form-group">
                    <label>Scan to Email</label>
                        <div class="checkbox">
                            <label>
                                <asp:RadioButtonList ID="p8_radioScanToEmail" runat="server" EnableViewState="true" 
                                OnSelectedIndexChanged="p8_radioScanToEmail_SelectedIndexChanged" AutoPostBack="true">
                                <asp:ListItem Value="0" Text="No"></asp:ListItem>
                                <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                                </asp:RadioButtonList>
                            </label>
                        </div>
                        <script>                            _doPostBack('<%# p8_radioScanToEmail.ClientID %>', '')</script>
                        <asp:UpdatePanel ID="UpdatePanelp8_stf" UpdateMode="Conditional" runat="server">
                            <ContentTemplate>
                                <asp:Label ID="p8_lblSelectedSMTPName" Visible="False" runat="server" Text="No Profile Selected Yet. Click button below to select one"></asp:Label><br />
                                <asp:Label ID="p8_lblSelectedSMTP" Visible="false" runat="server"></asp:Label>
                                <asp:Button ID="p8_btnSMTPServerSettings" Enabled="false"  
                            OnClick="p8_btnShowSMTPServerSettings_Click" CssClass="btn bg-green" runat="server" 
                            Text="SMTP Server Settings"></asp:Button>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="p8_radioScanToEmail" EventName="SelectedIndexChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </div>
 
Share this answer
 
v2
Comments
CHill60 13-Jun-17 19:00pm    
I doubt they are going to come back to you 3 years after posting the question. ...that they already accepted an answer to
PS Solutions 13-Jun-17 19:03pm    
hehe I agree but that answer was partially correct u know, if you use double underscore( I mean copy and paste), then your page/panel whatever will be keep refreshing for infinity.
Add the following properties to the updatePanel tag:
ChildrenAsTriggers="true"
and UpdateMode="Conditional".
 
Share this answer
 
v2

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