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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:13:22+00:00 2026-05-26T07:13:22+00:00

I have the following dropdownlist: <%@ Page Title= Language=C# MasterPageFile=~/myMasterPage.master AutoEventWireup=true CodeFile=testdropdown.aspx.cs Inherits=testdropdown %>

  • 0

I have the following dropdownlist:

<%@ Page Title="" Language="C#" MasterPageFile="~/myMasterPage.master" AutoEventWireup="true" CodeFile="testdropdown.aspx.cs" Inherits="testdropdown" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DropDownList ID="ddlDeliveryAddresses" runat="server" 
        DataTextField="delAddressShort" DataValueField="delID" 
        onselecteddindexchanged="ddlDeliveryAddresses_SelectedIndexChanged"
        AppendDataBoundItems="True" 
        AutoPostBack="True">
        <asp:ListItem Selected='True' Text='--select--' Value='-1'></asp:ListItem>    
    </asp:DropDownList>
</asp:Content>

And this code behind:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlConnection conn;
            SqlCommand comm;
            SqlDataReader reader;

            conn = new SqlConnection(iceConns.iconn);
            comm = new SqlCommand("Customers.sl_DeliverybyBillID", conn);
            comm.CommandType = CommandType.StoredProcedure;
            comm.Parameters.Add(new SqlParameter("@billID", SqlDbType.Int));
            comm.Parameters["@billID"].Value = 160;

            conn.Open();
            reader = comm.ExecuteReader();
            ddlDeliveryAddresses.DataSource = reader;
            ddlDeliveryAddresses.DataBind();
            reader.Close();
        }
    }
    protected void ddlDeliveryAddresses_SelectedIndexChanged(object sender, EventArgs e)
    {
        Label1.Text = ddlDeliveryAddresses.SelectedItem.Text;
    }

No matter what I do I can’t populate the label. All works great if I replace the databind with static listitems! I’ve tried pretty much all the suggestions around, but nothing works (well not for me anyway!).

  • 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-05-26T07:13:22+00:00Added an answer on May 26, 2026 at 7:13 am

    Your code says onselecteddindexchanged, it should be OnSelectedIndexChanged.

    The casing should not matter, but notice the extra “d” after onselected...

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

Sidebar

Related Questions

I have following simple code: <%@ Page Language=C# AutoEventWireup=true CodeBehind=testForm.aspx.cs Inherits=Orbs.testForm %> <html> <body>
I am using ASP.NET and in my .aspx page I have the following code,
I have the following JavaScript to disable a dropdownlist in a ASP.NET page, which
I have following dropdwonlists in a UserControl; <span class=src-engine-row-title-span>ADT : </span> <asp:DropDownList runat=server ID=ddlAdultTrf></asp:DropDownList>
I have the following multiview set up in my aspx page: <asp:MultiView id=MultiView1 runat=server
I have the following code that sets a cookie: string locale = ((DropDownList)this.LoginUser.FindControl(locale)).SelectedValue; HttpCookie
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new
I have the following code in a view: <div class=wrap_select> @Html.DropDownList(dateRange, new SelectList(Model.DateRange, Value,Text),
I have a formview on my aspx page containing various controls arranged using table.
I have the following JavaScript to toggle a dropdownlists in a ASP.NET page, which

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.