ASP.Net Page Load Event

Hi guys, I am trying to update an entry in my users table under Page Load Event. Below is the pseudo code of my script

If user exist based on the given ID And user status is Active Then
Set the user’s status to denied
Prompt the user with a message - user has been successfully denied.
Else
Prompt user with a message no record found.
Redirect user

If in case that the user’s status has been successfully updated, still the rest of the code will be executed. Meaning to say, the user’s status has been set to DENIED and of course I will get a message prompting prompting 'The user has been successfully denied but after a few seconds I will get the next message stating No record found and it will redirect on another page. Can anyone help me with this matter. Thank you so much.

hard to say without seeing the code.

I think you need to use braces at if and else. This might solve your problem. Either it is hard to say without code.

^^The code is pseudo code, so you don’t need to use braces.
Yeah, the actual code will help understanding the situation.

when you pass id. if mught be the case when it hit load id is not active yet