...
function void ShowError(int StateCode)
{
switch (StateCode)
{
case 404:
Response.Write("Sorry! Some error happened. This is a 404 Page!");
break;
...
}
}
...