This script shoould replaced :
ScriptManager.RegisterStartupScript(this, this.GetType(), "HidePopup", "$('#MyDispach').modal('show')", true);
to :
ScriptManager.RegisterStartupScript(this, this.GetType(), "HidePopup"+Guid.NewGuid().ToString(), "$('#MyDispach').modal('hide')", true);
Use developer mode, and run at console,
$('#MyDispach').modal("hide");
is the modal closed?
if your key isn't changed this script will only execute once
Other Wise You can Use
ClientScript.RegisterStartupScript
(GetType(),Guid.NewGuid().ToString(), "CloseModalPopup();",true);