Hi, Currently doing a C# ASP.Net web application in Visual Studio and I am currently stuck on registering a new user. Before I was able to register a new user without any problems, but now I cant for some reason. I haven't done anything to the code etc.
When i go to register the new user its accepts it and logs them im, but the user account details are saved into the ASP.NET security configuration!!
Thanks sukumarraju for your advice. I've now solved the problem, the solution was to get rid of some extra code I had written on the register button, when I got rid of this it then allowed me to register the user without any problems.
Marked as answer by tom_uni on Feb 28, 2013 07:39 AM
I've now solved the problem, the solution was to get rid of some extra code I had written on the register button, when I got rid of this it then allowed me to register the user without any problems.
Good to note that. Make sure that applicationName is provided to avoid any issues in future.
tom_uni
0 Points
8 Posts
Registering a new user
Feb 27, 2013 09:25 AM|LINK
Hi, Currently doing a C# ASP.Net web application in Visual Studio and I am currently stuck on registering a new user. Before I was able to register a new user without any problems, but now I cant for some reason. I haven't done anything to the code etc.
When i go to register the new user its accepts it and logs them im, but the user account details are saved into the ASP.NET security configuration!!
Any help/advice would be much appreciated, cheers
sukumarraju
All-Star
17351 Points
3059 Posts
Re: Registering a new user
Feb 27, 2013 02:45 PM|LINK
post your Web.config where sensitive info is hard coded.
Also refer http://weblogs.asp.net/sukumarraju/archive/2010/01/17/configuring-web-application-to-utilise-asp-net-application-services-database.aspx
Application Architecture Guide 2.0
My Blog
Twitter
tom_uni
0 Points
8 Posts
Re: Registering a new user
Feb 27, 2013 07:00 PM|LINK
<?xml version="1.0" encoding="utf-8"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <connectionStrings> <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-awsWebsite-20130227115939;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-awsWebsite-20130227115939.mdf" providerName="System.Data.SqlClient" /> <add name="ConnectionString" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\awsDatabase.mdf;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> <pages> <namespaces> <add namespace="System.Web.Optimization" /> </namespaces> <controls> <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /> </controls> </pages> <authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> </authentication> <profile defaultProvider="DefaultProfileProvider"> <providers> <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" /> </providers> </profile> <membership defaultProvider="DefaultMembershipProvider"> <providers> <add connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </providers> </membership> <roleManager enabled="true" defaultProvider="DefaultRoleProvider"> <providers> <add connectionStringName="DefaultConnection" applicationName="/" name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </providers> </roleManager> <sessionState mode="InProc" customProvider="DefaultSessionProvider"> <providers> <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" /> </providers> </sessionState> </system.web> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> </entityFramework> </configuration>sukumarraju
All-Star
17351 Points
3059 Posts
Re: Registering a new user
Feb 28, 2013 01:13 AM|LINK
Provide applicationName to Membership and role manager sections.
please elaborate the above.
Application Architecture Guide 2.0
My Blog
Twitter
tom_uni
0 Points
8 Posts
Re: Registering a new user
Feb 28, 2013 07:39 AM|LINK
Thanks sukumarraju for your advice. I've now solved the problem, the solution was to get rid of some extra code I had written on the register button, when I got rid of this it then allowed me to register the user without any problems.
sukumarraju
All-Star
17351 Points
3059 Posts
Re: Registering a new user
Feb 28, 2013 08:13 AM|LINK
Good to note that. Make sure that applicationName is provided to avoid any issues in future.
http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx
Application Architecture Guide 2.0
My Blog
Twitter