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 8804367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:35:09+00:00 2026-06-14T01:35:09+00:00

I have a non-databound Dropdownlist inside of an UpdatePanel: <asp:UpdatePanel runat=server ID=FiltersUpdPnl> <ContentTemplate> <div

  • 0

I have a non-databound Dropdownlist inside of an UpdatePanel:

<asp:UpdatePanel runat="server" ID="FiltersUpdPnl">
    <ContentTemplate>
        <div class="filters">
            <asp:Button runat="server" ID="ExportBtn" Text="Export Map to Image" />
            <br />
            Show: 
            <asp:DropDownList runat="server" ID="CapNumProjectsDDL" AutoPostBack="true" OnSelectedIndexChanged="ApplyFilters" OnPreRender="CapNumProjectsDDL_PreRender">
                <%--<asp:ListItem Value="0" Text="" Selected="True"></asp:ListItem>--%>
                <asp:ListItem Value="1" Text="Capacity"></asp:ListItem>
                <asp:ListItem Value="2" Text="Number of Projects"></asp:ListItem>
            </asp:DropDownList>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

The event handler isn’t terribly important, it just does stuff:

protected void ApplyFilters(object sender, EventArgs e)
{
    //Do Stuff relating to the selected Value
}

When the page loads, “Capacity” is selected by default, as it’s the first ListItem. When I switch off to “Number of Projects”, the event handler fires as expected, executing the code. But when I switch back to “Capacity”, the handler does NOT fire. The Postback is occurring, but I want it to specifically hit the event handler on both listitems.

You can see that I have a commented-out “0-value” ListItem in there. When I uncomment that, both “Capacity” and “Number of Projects” will hit the event handler as expected.

The issue is that when the page loads, it’s loading the data relevant to the “Capacity” dropdown, so I want the “Capacity” ListItem to be showing, but be able to fire the event handler when selected.

Am I missing something obvious here?

E: I tried adding a handler for the DDL_Prerender event, setting the SelectedIndex to like 200 or something clearly not in the list, hoping it would de-select “Capacity”, but that didn’t work either.

This is the Pre-render code:

protected void CapNumProjectsDDL_PreRender(object sender, EventArgs e)
{
    CapNumProjectsDDL.SelectedIndex = 200;
}

This didn’t change the way it worked.

  • 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-14T01:35:10+00:00Added an answer on June 14, 2026 at 1:35 am

    It seems that you want that drop down element raise change even if you select in drop down box already selected item. I believe that this will not work, and the cause of the problem is not in server side asp.net dropdownlist control, but in how HTML select element is working to which DropDownList control is rendered.

    The problem is that HTML select element doesn’t fire change event if user select the same item as was before drop box was shown (because from the point of view of control state – it was not changed).

    So, I believe that the behavior that you want can be implement, but you should not use HTML select control and instead of it implement custom solution.

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

Sidebar

Related Questions

I have a non databound DGV (no datasource, etc; rows added manually). To filter
I have non-template class with a templatized constructor. This code compiles for me. But
I have a non scrolling UITableView inside of a larger UIScrollView. Since the table
I have a non-Activity class (let's call it NonActivity) that needs to post a
I am trying have non-blocking I/O between a server and client. After the two
I have non-ascii chars in velocity template files. And when processed they are garbled.
I have a non ode function that calculates based on the previous time step
I have an (non-virtualized) ItemsControl that binds its ItemsSource to a ObeservableCollection of ViewModel
I have some non well-formed xml (HTML) data in JAVA, I used JAXP Dom,
I have a non transparent, colour bitmap with length 2480 and width 3507. Using

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.