i am creating a web site where i put my login control in login view now i want that when anyone click on the dowload this picture button then a check shuld be perform that the user is logged in if no then a login form should be open.
how can i do this.
please help me !
thanks
chester
Loading
Kirtan PatelPosted Nov 12, 2009, 11:34 AM
Here is code how you can do this
if my answer helps you then check "do you like this answer checkbox" please :)
protected void Button1_Click(object sender, EventArgs e)
{
if (User.Identity.IsAuthenticated == true)
{
//Do Whatever you want to Do if User is Logged
}
else
{
//Open Login Form
Response.Redirect("~/Login.aspx");
}
}