protected void dlistApplications_SelectedIndexChanged(object sender, EventArgs e)
{
int applicationID = 0;
if (!int.TryParse(dlistApplications.SelectedValue, out applicationID))
{
gViewReferences.Visible = false;
btnUpdateList.Visible = false;
reqValApplications.Validate();
return; //Return if the selected value is not a valid applicationID
}
Application currentApplication = ApplicationBLL.GetByID(applicationID);
gViewReferences.DataSource = currentApplication.References;
gViewReferences.DataBind();
gViewReferences.Visible = true; //Show the references grid
btnUpdateList.Visible = gViewReferences.Rows.Count > 0;
}