Last post Aug 11, 2016 10:48 AM by Chris Zhao
Aug 09, 2016 09:29 PM|aazizasp|LINK
I have a question about creating a login control in an asp.net webform.
I created a new project >> web forms (not empty) and then it generated several directories for me including account.
I went to the main web.config file and edited the DefaultConnection attribute connection string to a remote SQL server. I ran the Registration.aspx web form under the Account directory and created a new user name and I was successful. I logged in to the
remote database and confirmed the creation of several tables. The user name was created in one of the new tables. I then created a new login page outside the content folder under the root of the project and set it to be the startup page for the project. I
added a login control to this page and changed its DestinationPageUrl property to a page under the content folder. When I run the application and try to log in using the new account with the login control I get this error message:
Default Membership Provider must be specified
I have no Idea how to create this.
Aug 10, 2016 06:43 AM|Chris Zhao|LINK
Here , I have shared a link of Microsoft Documentation of How to specify Default Provider.
In that they had mentioned an example of that.
You need to add <Membership> in Web.Config File like below.
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
Configuring an ASP.NET Application to Use Membership
Aug 10, 2016 02:42 PM|aazizasp|LINK
I edited the web.config file and added the suggested code and when I run it I get the following error:
Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
If it helps:
here is the default code for the membership attribute in my main web.config file.
ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
Maybe I am using the wrong template. Is this possible? What I did is I created a new project from Visual studio Pro 2013 >> new >> project >> ASP.NET Web Application >> Web Forms.
I ran the Register.aspx page and created an account. After that I created a Separate Login.aspx page (there is one under Account directory). Then I added an ASP Login control. The default Login page works when I type in the user credentials but when I use
the login control under the Login page under the root, it doesn't recognize any membership provider because according to the web.config file it is disabled.
Aug 11, 2016 10:48 AM|Chris Zhao|LINK
When you create a new project, at that time it will use a new Asp.net Identity.
You can add your membership providers after that.
For more detailed information regarding this, you can visit link below.
Getting started with Asp.net Identity
Introducing ASP.NET Identity – A membership system for ASP.NET applications
Then if we talk about the error, then for that I find the link has the same issue like yours.
Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'