Hi all,

Iam using form authentication in my web app. After user login i want to redirect depends on user info.
My problem is :

User.Identity.name is blank in login page but its working fine in other page.

Forms Authentication in web.config file

<forms name="Authcookie" loginUrl="LogIn.aspx" protection="All" />

private

void btnlogin_Click(object sender, System.EventArgs e)
{ if(checking User credentials)


{ Id=somevalue;
FormsAuthentication.SetAuthCookie(Id.ToString(),false);

Response.Write(User.Identity.Name.ToString());

//Response.Write(Context.User.Identity.Name.ToString());

}
}

Thanks in advance