I have created a login page in asp.net and created a user and role in asp.net membership, after login I have a query in my page load method to check the role of user and display a view of the page as per that user but I am getting this error.
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
My code:
protected void Page_Load(object sender, EventArgs e)
{
if (Page.User.Identity.IsAuthenticated)
{
if (Roles.IsUserInRole("Manager"))
{
NavigationMenu.Visible = false;
NavigateMenu1.Visible = true;
creategrid();
}
}
}
This exception only occurs as I run my application for the first time and as I refresh page try to login again then there is no exceptions. please help me as I am new this.