This may be helpful to you:
<script type="text/javascript">
function Showalert() {
alert('Profile not parsed!!');
window.parent.parent.parent.location.reload();
}
function ImportingDone() {
alert('Importing done successfull.!');
window.parent.parent.parent.location.reload();
}
</script>
if (SelectedRowCount == 0)
{
ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);
}
else
{
ScriptManager.RegisterStartupScript(this, GetType(), "importingdone", "ImportingDone();", true);
}