I have a logging off function in my application. but it does not work correctly.
So i tried for last two days to do that. but i couldn't. \
This is the link to Action
------------------------------
<a href="@Url.Action("LogOut","Account")" class="cc-font-min">Log off</a></p>
This is the my Action for that
---------------------------------
public ActionResult LogOut()
{
Session.Clear();
WebSecurity.Logout();
return RedirectToAction("Index", "Home");
}
And also this is the error that is follow me always. :)
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
This is the part of my web.config file
------------------------------
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="InboxPath" value="C:\test" />
<add key="UploadPath" value="C:\uploaded" />
<add key="UploadPathV" value="http://localhost/pn/uploaded"/>
<add key="creditorFolders" value="test" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<roleManager enabled="true" />
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="60">
<providers>
<clear />
<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" connectionStringName="USCP" applicationName="CreditorPortal" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" />
</providers>
</membership>
<httpRuntime targetFramework="4.5" maxRequestLength="1048576" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1048576000" />
</requestFiltering>
</security>
</system.webServer>