you can use this by placing a piece of code in a try catch block
if your code gets some error than in your catch block, call the js function in this redirect to the error page.
try
{
//your code
}
catch
{
Page.RegisterStartupScript("RefreshParent","<script language='javascript'>RefreshParent()</script>");
}
<script language="javascript">
function RefreshParent()
{
window.parent.location.href = "myErrorPage.aspx";
}
</script>
you can do something like this.
source
share