Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All

I am getting the following error whenever I hit the logoff link on my page

Compiler Error Message: CS1061: 'ASP.newsmastermaster_master' does not contain a definition for 'unnamed_loggingout' and no extension method 'unnamed_loggingout' accepting a first argument of type 'ASP.newsmastermaster_master' could be found (are you missing a using directive or an assembly reference?)


the loginstatus link is as follows

<asp:loginstatus runat="server" logoutaction="redirect" logouttext="log off" logoutpageurl="~/Account/Login.aspx" onloggingout="unnamed_loggingout" />

please tell me how to fix it?

Regards
Posted

1 solution

you need to have method in your aspx code behind file with signature as below
C#
void unnamed_loggingout(Object sender, System.Web.UI.WebControls.LoginCancelEventArgs e)
    {
        //do something ...
    }
 
Share this answer
 
Comments
AmyAli 26-Aug-15 1:12am    
Still getting the error

<asp:LoginStatus runat="server" LogoutAction="Redirect" LogoutText="Log off" LogoutPageUrl="~/Index.aspx" OnLoggingOut="Unnamed_LoggingOut" />

However I have added definition on code behind file as follows

void unnamed_loggingout(Object sender, System.Web.UI.WebControls.LoginCancelEventArgs e)
{
//do something ...
Context.GetOwinContext().Authentication.SignOut();

}
DamithSL 26-Aug-15 1:16am    
it should be OnLoggingOut="unnamed_loggingout" (all lower case in your event definition)
AmyAli 26-Aug-15 5:19am    
Thank you very much. It is working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900