What errors are you getting? Are there exceptions? Or does the code just not seem to be doing the check in the Page_Load?
I would guess that your check in the Page_Load is working. However, you have no code to stop the Button1_Click event from firing. When you find that the user already exists, you need to stop the Button1_Click event from processing.
One option for this is calling the Response.End() method:
<br />
if (temp == 1)<br />
{<br />
Response.Write("User already exists");<br />
Response.End();<br />
}<br />
You could do this by setting some variable (bool _userExists) on the form when the (temp == 1) and then have the Button1_Click event check that value -- if (_userExists) return