خرید بک لینک

Vote count: 0

I have tried populating the dropdownlist in the code behind but it shows an error "stateID does not exist in the current context". THe dropdownlist is inside the datalist

ASPX:

<asp:DataList runat="server" ID="dataList" OnItemDataBound="dataList_ItemDataBound"  RepeatDirection="Vertical">
 <ItemTemplate>
<asp:DropDownList ID="stateID" AutoPostBack="true"  cssclass="form-input" runat="server"></asp:DropDownList>
<asp:DropDownList ID="cityID" AutoPostBack="true"  cssclass="form-input" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:DataList>

CodeBehind:

public void LoadStates()    {
 stateID.DataTextField = "Name";
 stateID.DataValueField = "ID";
}


Error: stateID does not exist in the current context.

asked 45 secs ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 4 ارديبهشت 1395 ساعت: 12:47

صفحه بندی