Note that there are some explanatory texts on larger screens.

plurals
  1. POError securing application with users\roles
    text
    copied!<p>Trying to use security features and create Forms Authentication in my MVC3 application I Used Project-ASP.Net Configuration which opened ASP.Net Web Site Administration Tool. I went to Security-Roles Management, added a role and tried to manage users attached to it. When try to check a box to attach user <a href="http://i.stack.imgur.com/WJV74.png" rel="nofollow">http://i.stack.imgur.com/WJV74.png</a></p> <p>I've got an error.</p> <pre><code>An error was encountered. Please return to the previous page and try again. The following message may help in diagnosing the problem: The user 'user' was not found. at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_roles_managesinglerole_aspx.EnabledChanged(Object sender, EventArgs e) at System.Web.UI.WebControls.CheckBox.OnCheckedChanged(EventArgs e) at System.Web.UI.WebControls.CheckBox.RaisePostDataChangedEvent() at System.Web.UI.WebControls.CheckBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() at System.Web.UI.Page.RaiseChangedEvents() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) </code></pre> <p>May be it is smth wrong in Web.config?</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=152368 --&gt; &lt;configuration&gt; &lt;connectionStrings&gt; &lt;add name="MusicStoreDB" providerName="System.Data.SqlClient" connectionString="Data Source=my-pc;Initial Catalog=MusicStoreDB;User Id=usr;Password=1;" /&gt; &lt;add name="SecDB" providerName="System.Data.SqlClient" connectionString="Data Source=my-pc;Initial Catalog=SecDB;User Id=usr;Password=1;" /&gt; &lt;/connectionStrings&gt; &lt;appSettings&gt; &lt;add key="webpages:Version" value="1.0.0.0"/&gt; &lt;add key="ClientValidationEnabled" value="true"/&gt; &lt;add key="UnobtrusiveJavaScriptEnabled" value="true"/&gt; &lt;/appSettings&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="adm" /&gt; &lt;allow roles="adm" /&gt; &lt;/authorization&gt; &lt;globalization culture="en-US" /&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/Account/LogOn" timeout="2880" /&gt; &lt;/authentication&gt; &lt;membership&gt; &lt;providers&gt; &lt;clear/&gt; &lt;add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SecDB" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /&gt; &lt;/providers&gt; &lt;/membership&gt; &lt;profile&gt; &lt;providers&gt; &lt;clear/&gt; &lt;add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="SecDB" applicationName="/" /&gt; &lt;/providers&gt; &lt;/profile&gt; &lt;roleManager enabled="true" defaultProvider="DefaultRoleProvider"&gt; &lt;providers&gt; &lt;add connectionStringName="SecDB" applicationName="/" name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider" /&gt; &lt;/providers&gt; &lt;/roleManager&gt; &lt;pages&gt; &lt;namespaces&gt; &lt;add namespace="System.Web.Helpers" /&gt; &lt;add namespace="System.Web.Mvc" /&gt; &lt;add namespace="System.Web.Mvc.Ajax" /&gt; &lt;add namespace="System.Web.Mvc.Html" /&gt; &lt;add namespace="System.Web.Routing" /&gt; &lt;add namespace="System.Web.WebPages"/&gt; &lt;/namespaces&gt; &lt;/pages&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;validation validateIntegratedModeConfiguration="false"/&gt; &lt;modules runAllManagedModulesForAllRequests="true"/&gt; &lt;/system.webServer&gt; &lt;runtime&gt; &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt; &lt;bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; &lt;/configuration&gt; </code></pre> <p>help please</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload