Providing you how to resolve this with simplest example possible.You can get overview and implement it.
Aspx page:
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="1995" Selected="True" Value="1995" />
<asp:ListItem Text="1996" Value="1996" />
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true"
onselectedindexchanged="DropDownList2_SelectedIndexChanged">
<asp:ListItem Text="1995" Selected="True" Value="1995" />
<asp:ListItem Text="1996" Value="1996" />
<asp:ListItem Text="1997" Value="1997" />
<asp:ListItem Text="1998" Value="1998" />
</asp:DropDownList>
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
Code behind:
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
if (Convert.ToInt32(DropDownList2.SelectedValue) < Convert.ToInt32(DropDownList1.SelectedValue))
{
Label3.Text = "error";
}
else
{
Label3.Text = "ok";
}
}
You can see that on changing the value of second drop down the code checks the two values,if the second one is lower then label shows text error,otherwise it displays ok.