User-821857111 posted
If you only want code to be executed under certain conditions, you need to code those conditions. If you do not want code to be executed when the form has been submitted, eitehr put it after the Response.Redirect call or put it in an if(!IsPost) block.