I created the sample for role authentication in asp.net 2005. I created the login panel on my default.aspx page and after login it works fine. Iused the code as below for login
FormsAuthentication.RedirectFromLoginPage(txtUName.Text, true, urlpath);
FormsAuthentication.SetAuthCookie(txtUName.Text, true);
Response.Redirect(urlpath, false);
I used all required page links in a single master page that is shown after login. I used the code in master page for "logout" like below on clicks of link button
try
{
Response.Redirect("~/Logout.aspx" );
}
catch (Exception ee)
{
return;
}
Now when I logout from master page I got an error like this
unable to evaluate expression because the code is optimized or native frame is on top of call stack
I have goggled but not got the solution. I am unable to find-out the reason behind this. Please provide the proper solution. Thanks