Faye_DBA
asked on
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="AreaTypeNam
<asp:ListItem Value="-- Choose one --" Text="-- Choose one --"></asp:ListItem>
<asp:ListItem Value="gv" Text="Governor"></asp:List
<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_SelectedIndexChange
{
Session["ITEMS"] = (string)Session["ITEMS"] + "6608|";
string sValue = ((DropDownList)sender).Sel
PoliticalGeographyWS.KeyVa
PoliticalGeographyWS.SOAPA
soapAuth.Username = Session["UserName"].ToStri
soapAuth.Password = imapdata.CoreServices.Syst
PoliticalGeographyWS.Polit
pg.SOAPAuthValue = soapAuth;
try
{
switch (sValue)
{
case "State":
maplevel = "st";
kvo = pg.GetStates();
if (kvo != null && kvo.Length > 0)
{
DDDistrictOption.DataSourc
DDDistrictOption.DataTextF
DDDistrictOption.DataValue
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_
DbAccess db = new DbAccess();
db.ConnectionString = SystemUtilities.GetApplica
DataSet dsSenate = db.GetDataSet(sql);
if (dsSenate != null && dsSenate.Tables[0].Rows.Co
{
DDDistrictOption.DataSourc
DDDistrictOption.DataTextF
DDDistrictOption.DataValue
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
}
}
break;
case "State House District":
maplevel = "sh";
kvo = pg.GetSTHDistricts(null);
if (kvo != null && kvo.Length > 0)
{
DDDistrictOption.DataSourc
DDDistrictOption.DataTextF
DDDistrictOption.DataValue
DDDistrictOption.DataBind(
}
break;
case "State Senate District":
maplevel = "ss";
kvo = pg.GetSTSDistricts(null);
if (kvo != null && kvo.Length > 0)
{
DDDistrictOption.DataSourc
DDDistrictOption.DataTextF
DDDistrictOption.DataValue
DDDistrictOption.DataBind(
}
break;
default:
break;
}
DDDistrictOption.Items.Ins
// Set the caption
idCaption.InnerText = "Select the " + DDArea.SelectedValue + " that you want to Isolate by.";
}
catch (Exception ex)
{
IMAPLog.Error(this.GetType
//idMessage.Text = ex.Message;
}
// Set Controls visibility
DDArea.Visible = false;
DDDistrictOption.Visible = true;
this.DDDistrictOption.Attr
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.