I have tried several times and I came to the point that this problem occurs only when I put the code in Login.Authenticate event. From MSDN, it's almost clear that Authenticate event raises when user use Login control to log into the system. The main objective of this event is to perform any tasks while checking the user for authentication.
So,I tried Login.LoggedIn event that raises just after the Login.Authenticate event. LoggedIn event is responsible for any tasks that is needed to perform after validation (e.g. Accessing to the per-user data, redirecting user to different pages etc.)
For my case, I need LoggedIn event, So I tried the following code:
//code behind file
protected void Login_LoggedIn(object sender, EventArgs e)
if (Roles.IsUserInRole(Login.UserName, "Member"))
else if (Roles.IsUserInRole(Login.UserName, "Admin"))
HTML Code for frmUserLogin.aspx
<![CDATA[<%@ Page Title="" Language="C#" MasterPageFile="~/mainLayout.Master" AutoEventWireup="true" CodeBehind="frmUserLogin.aspx.cs" Inherits="OnlineTMS_MIST.frmUserLogin" %>
<asp:content id="Content1" contentplaceholderid="head" runat="server" xmlns:asp="#unknown">
<asp:content id="Content2" contentplaceholderid="ContentPlaceHolder1" runat="server" xmlns:asp="#unknown">
<asp:login id="Login" runat="server">
It works for me absolutely fine. Thanks a lot.