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

  • SEARCH
  • Home
  • 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 8844281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:26:49+00:00 2026-06-14T11:26:49+00:00

I am working on a metrics screen that will display several charts based on

  • 0

I am working on a metrics screen that will display several charts based on different groups in a database. Part of it uses a function that hides selected charts until the user clicks to display them.

The problem is this: I’m using a Databind on the dropdownlist, so every time I select a new group, the page refreshes and everything returns to its default state.

My question is this: Is there a way that I can avoid refreshing the page every time I select a new option from the dropdown list? If so, how? If not, is there a better way to create the dropdownlist and attach values to it? If I set AppendDataBoundItems to false, then I always get the selected value as the first item in the list.

Here’s my code for the dropdownlist:

    <asp:DropDownList ID="MinistryDropdown" OnSelectedIndexChanged="Selection_Change" AutoPostback="true" AppendDataBoundItems="true" runat="server"/>

Then C# code behind it is this:

public void Page_Load(object sender, EventArgs e){
    MinistryDropdown.DataSource = CreateDataSource();
    MinistryDropdown.DataTextField = "Description";
    MinistryDropdown.DataValueField = "Description";
    MinistryDropdown.DataBind();

...other code here...
}
ICollection CreateDataSource(){
    DataTable Ministries = new DataTable();

    Ministries = oDatabase.GetData(@"SELECT DISTINCT B.Description
        FROM tblInvolvement AS A LEFT JOIN tblMinistries AS B
        ON A.Activity = B.MinistryID");

    DataView dv = new DataView(Ministries);
    return dv;
}
  • 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-14T11:26:51+00:00Added an answer on June 14, 2026 at 11:26 am

    Try to use the ASP.NET UpdatePanel. Just wrap your DropDownList in it, and it should works. Here is a quick example that I didn’t test.

    <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel runat="server" UpdateMode="Conditional">
        <ContentTemplate>
           <asp:DropDownList ID="MinistryDropdown" OnSelectedIndexChanged="Selection_Change" AutoPostback="true" AppendDataBoundItems="true" runat="server"/>
        </ContentTemplate>
    </asp:UpdatePanel>
    

    On a final note, you will soon find out the limits of this solution, and later you might prefer to use Javascript instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a .NET project that uses Jenkins as the CI server. The
I'm working on (what should be) a simple script that will add text to
I'm working with a framework that uses collections derived from System.Collections.CollectionBase . Users have
We are working on an application in CakePHP that will be used by multiple
So I'm working on a web application that uses jquery to parse xml data
I am working with Pentaho Data Integration (aka Kettle) and I have several Transformations,
I am working on Java source codes that are in JAR format. I've download
I created a database for tracking metrics, with some automation tricks (email, .doc,.ppt presentations,
I have several javascript files that during run-time get combined and minified. This is
I'm working on a java component that tags events with a date window for

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.