views:

7

answers:

0

Hi,

I am having the code for selectedIndexChanged event of a DropDownList in Asp.Net that looks somewhat like this

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

{ //Get the value of Base category on the basis of the new index selected.

if(BaseCategory belongs to (SomeValues))
{
    //do some actions based on the new selected index.
    //Load appropriate UI.
}
else
{
    //Something like
     oEvent.cancelPostBack = true;
     return;

}

}

I know that I can achieve the same objective by tweaking the code a bit, But I am more interested to know if .NET provides any such implementation.