Just wanna ask u guys for help. I have this dropdown menu in my abc.aspx page. There, user will choose month and enter the expenses and prices in the textbox provided. It will b
Why not try the following:
ASPX
<asp:DropDownList ID="DropDownList1" runat="server" Font-Bold="True" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Text="Please choose" Value=""></asp:ListItem>
<asp:ListItem Text="January" Value="January"></asp:ListItem>
<asp:ListItem Text="February" Value="February"></asp:ListItem>
<asp:ListItem Text="March" Value="March"></asp:ListItem>
</asp:DropDownList>
C#
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (Session["Month"] != null)
{
if (DropDownList1.SelectedValue == Session["Month"])
{
DropDownList1.SelectedValue = string.Empty;
}
else
{
Session["Month"] = DropDownList1.SelectedValue;
}
}
}
Make this is the ASPX and C# on your first page.