Reputation: 270
ASPX FILE
contain DropDown
as Follows:
< asp:DropDownList ID="drpDist" runat="server" CssClass="dropDownStyle" OnSelectedIndexChanged="drpDist_SelectedIndexChanged" TabIndex="6">
In ASPX.CS FILE
protected void drpDist_SelectedIndexChanged(object sender, EventArgs e)
{
}
Please Help me.I can't get why it is not working.
Upvotes: 1
Views: 147
Reputation: 63105
you need to set AutoPostBack="true"
<asp:DropDownList ID="drpDist" runat="server" AutoPostBack="true">
when you set that property as true, a postback to the server automatically occurs whenever the user changes the selection of the list
Upvotes: 3
Reputation: 13484
Set AutoPostBack="true"
< asp:DropDownList ID="drpDist" runat="server" AutoPostBack="true" CssClass="dropDownStyle" OnSelectedIndexChanged="drpDist_SelectedIndexChanged" TabIndex="6">
Upvotes: 0
Reputation: 703
You need to set the AutoPostBack="True"
property. This will make the page to postback automatically hence firing your event.
Upvotes: 1