If you Use Link Button,
the rename the link button at clicking;
means:-
when logout :- just rename it with
linkButton1.text="Login";
and clear the cookie and session.
Then it will Convert to login.
when Login :- just rename it with
linkButton1.text="Logout";
and on PageLoad() event
check ur session and cookie :
if it is then then u R Logged in.
and rename:-
linkButton1.text="Logout";
by Default Take Link Button text= Login.
Or Else just Upload ur coding or Just Masterpage .