Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8565427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:25:28+00:00 2026-06-11T17:25:28+00:00

I have a problem in my DropdownList in asp.net C# when I select a

  • 0

I have a problem in my DropdownList in asp.net C# when I select a bank in my bankDDL, the branchDDL doesn’t update automatically, It needs to be selected first before the branchDDL be updated. and Im using Jquery language to populate data on my branchDDL in runtime.

var branch = $("#<%=cboBranch.ClientID%>");

    $("#<%=cboBank.ClientID%>").change(function () {

        branch.html("");//this is my first problem this doesnt show after my bank is change
        branch.append($("<option></option>").val(-1).html("Please select Branch"));//also this
        if ($(this).val() != -1) {
            OnGetNotes(parseInt($(this).val()));//this function get the JSON and populate the
                                                //branch according to what bank is selected
                                                //and it show the branch using slideDown 
        }
        else {
            $("#branch").slideUp();
        }
    });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:25:30+00:00Added an answer on June 11, 2026 at 5:25 pm

    Instead of .html() use .empty() .
    Also make sure you have your code inside DOM ready event.. Try this

    $(function() {
    
        var branch = $("#<%=cboBranch.ClientID%>");
    
        $("#<%=cboBank.ClientID%>").on('change', function() {
            branch.empty().append($("<option></option>").val(-1).html("Please select Branch")); //also this
            if ($(this).val() != -1) {
                OnGetNotes(parseInt($(this).val()));
            }
            else {
                $("#branch").slideUp();
            }
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using asp.net mvc 2.0(default binding model) and I have this problem. I
I have an asp.net Dropdownlist with autopostback enabled. It is not populated dynamically, its
I have an ASP.Net MVC page where I want to use AJAX to update
I have an ASP.NET dropdownlist like this: <asp:DropDownList ID=ddlMyDropDown runat=server> <asp:ListItem>Please pick one</asp:ListItem> <asp:ListItem>option1</asp:ListItem>
I'm having a conceptual problem. I have this asp.net page to manage code snippets.
I have this ASP.NET code: <asp:DropDownList ID=ddlBrokers runat=server AutoPostBack=true DataSourceID=srcBrokers DataTextField=broker DataValueField=brokerId /> <asp:ObjectDataSource
I am using asp.net 3.5 with the ajax toolkit. The problem: I have a
First some background: I have a website using ASP.NET web forms + jQuery 1.6.4
I have recently found a strange behaviour inside of the ASP.NET DropDownList that I
I have an ASP.NET DDL that looks like this when I view source: <select

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.