By moving all the
<% // some code parts here %>
into your code behind file. You should also write into the aspx pages page directive what the name of your code behind file is.
Cheers!
—MRBP.S: Without knowing anything of the structure and content of your login.aspx it would be kind of hard to give any solid advice, wouldn't it?