webform.aspx does not contain the definition for DropDownlist_SelectedIndexChanged()



Based on my code when I try to view in the browser, why do I get an error message that my web page does not contain a definition for procedure:

This is a part of my web page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Wizard.aspx.cs"%>
<asp:DropDownList ID="DDArea" runat="server" Width="252px" DataTextField="AreaTypeName" DataValueField="AreaTypeCode" OnSelectedIndexChanged="DDArea_SelectedIndexChanged">
                <asp:ListItem Value="-- Choose one --" Text="-- Choose one --"></asp:ListItem>                                                        
                        <asp:ListItem Value="gv" Text="Governor"></asp:ListItem>
                        <asp:ListItem Value="se" Text="U.S. Senate"></asp:ListItem>
                        <asp:ListItem Value="cd" Text="Congressional District"></asp:ListItem>
                        <asp:ListItem Value="ss" Text="State Senate District"></asp:ListItem>
                        <asp:ListItem Value="sh" Text="State House District"></asp:ListItem>                              
       </asp:DropDownList>

Then in the code behind, I have the following code:  (Wizard.aspx.cs)
 public partial class Plugin : System.Web.UI.Page
    {
       
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (DDArea.Visible)
            {
                DDArea.AutoPostBack = true;
                DDArea.CssClass = "StandardText";
                DDDistrictOption.CssClass = "StandardText";
                           }
                 }

        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
           
            base.OnInit(e);
        }

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
       
        #endregion

       


        protected void DDArea_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            Session["ITEMS"] = (string)Session["ITEMS"] + "6608|";
            string sValue = ((DropDownList)sender).SelectedValue;

            PoliticalGeographyWS.KeyValueObject[] kvo = null;

            PoliticalGeographyWS.SOAPAuth soapAuth = new Plugin_QuickReports_Arts.PoliticalGeographyWS.SOAPAuth();
            soapAuth.Username = Session["UserName"].ToString();
            soapAuth.Password = imapdata.CoreServices.SystemUtilities.GetApplicationConfigurationValue("WebServiceKey", true);
            PoliticalGeographyWS.PoliticalGeography pg = new Plugin_QuickReports_Arts.PoliticalGeographyWS.PoliticalGeography();
            pg.SOAPAuthValue = soapAuth;
            try
            {
                switch (sValue)
                {
                    case "State":
                        maplevel = "st";
                        kvo = pg.GetStates();
                        if (kvo != null && kvo.Length > 0)
                        {
                            DDDistrictOption.DataSource = kvo;
                            DDDistrictOption.DataTextField = "Value";
                            DDDistrictOption.DataValueField = "Key";
                            DDDistrictOption.DataBind();
                        }
                        break;
                    case "U.S. Senator":
                        maplevel = "sn";
                        string sql = "select StateName as [Key], POLY_ID + ' : ' +  [name] as Value from mgsql.V_political.dbo.USS_CY_Senators order by POLY_ID";
                        DbAccess db = new DbAccess();
                        db.ConnectionString = SystemUtilities.GetApplicationConfigurationValue("SystemDbRead", true);
                        DataSet dsSenate = db.GetDataSet(sql);
                        if (dsSenate != null && dsSenate.Tables[0].Rows.Count > 0)
                        {
                            DDDistrictOption.DataSource = dsSenate.Tables[0]; ;
                            DDDistrictOption.DataTextField = "Value";
                            DDDistrictOption.DataValueField = "Key";
                            DDDistrictOption.DataBind();
                        }
                        break;
                    case "Congressional District":
                        maplevel = "cd";
                        kvo = pg.GetCNGDistricts("");
                        if (kvo != null && kvo.Length > 0)
                        {
                            for (int i = 0; i < kvo.Length; i++)
                            {
                                string sFeatureId = kvo[i].Key; // rdr.GetValue(0).ToString();
                                string sFeatureName = kvo[i].Key;
                                sFeatureName = sFeatureName.Substring(0, 2) + sFeatureName.Substring(6, 2);
                                DDDistrictOption.Items.Add(new ListItem(sFeatureName, sFeatureId));
                            }

                        }
                        break;
                    case "State House District":
                        maplevel = "sh";
                        kvo = pg.GetSTHDistricts(null);
                        if (kvo != null && kvo.Length > 0)
                        {
                            DDDistrictOption.DataSource = kvo;
                            DDDistrictOption.DataTextField = "Key";
                            DDDistrictOption.DataValueField = "Key";
                            DDDistrictOption.DataBind();
                        }
                        break;
                    case "State Senate District":
                        maplevel = "ss";
                        kvo = pg.GetSTSDistricts(null);
                        if (kvo != null && kvo.Length > 0)
                        {
                            DDDistrictOption.DataSource = kvo;
                            DDDistrictOption.DataTextField = "Key";
                            DDDistrictOption.DataValueField = "Key";
                            DDDistrictOption.DataBind();
                        }
                        break;
                    default:
                        break;

                }
                DDDistrictOption.Items.Insert(0, new ListItem("-Select the Area-", "-1"));

                // Set the caption
                idCaption.InnerText = "Select the " + DDArea.SelectedValue + " that you want to Isolate by.";
            }
            catch (Exception ex)
            {
                IMAPLog.Error(this.GetType(), ex);
                //idMessage.Text = ex.Message;
            }

            // Set Controls visibility
            DDArea.Visible = false;
            DDDistrictOption.Visible = true;
            this.DDDistrictOption.Attributes.Add("onchange", "ZoomtoArea('" + maplevel + "');");

        }

    }
}

Faye_DBAAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
If you look here:

<asp:DropDownList ID="DDArea" runat="server" Width="252px" DataTextField="AreaTypeName" DataValueField="AreaTypeCode" OnSelectedIndexChanged="DDArea_SelectedIndexChanged">

and here:

OnSelectedIndexChanged="DDArea_SelectedIndexChanged"

you need an event handler called 'DDArea_SelectedIndexChanged'.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.