Save the record count to ViewState (or Session) then check if it changes on PostBack, using RegisterClientScriptBlock to cause the prompt:
if( !IsPostBack )
{
int recordCount;
//determine recordCount
ViewState["records"] = recordCount;
}
else
{
int newRecordCount;
int oldRecordCount;
oldRecordCount = (int)ViewState["records"] );
//determind new record count
if( oldRecordCount != newRecordCount )
{
Page.RegisterClientScriptBlock("AlertScript",
"<script language='javascript'>alert('record count changed')</script>");
//update record count in ViewState
ViewState["records"] = newRecordCount;
}
}