Hi all,
In an aspx page a grid is populated with values selected from the year drop down list and the month drop down list.
There is the possibility that for that year and for that month there is no data available to extract and publish on the gridview.
In this case I have to alert that there is no data and redirect the user to the previous situation.
I tried this code but the page is reloaded from scratch and loses what is selected in the year and month drop down lists.
How to do resolve this?
if (ds.Tables[0].Rows.Count > 0)
{
dt = ds.Tables[0];
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('No data');" +
"window.location='Default.aspx';", true);
}