Is there an example of how to implement the ASP.NET Identity support for a Web Form application? I have followed the online example for ADO.NET implementation and MVC and it works like a charm with Oracle 12c, but no information on how to implement with a Web Forms application. There is no Account controller in the Web Forms app, and the code in the IdentityModels.cs class is substantially different.
I realize most folks are using MVC instead of Web Forms for new applications, but we may be forced to use Web Forms in our case.
ASP.NET Identity for Web Forms
Re: ASP.NET Identity for Web Forms
Sorry for the delay. We will notify you when the corresponding walkthrough for Web Form applications is implemented.
Re: ASP.NET Identity for Web Forms
Please follow the tutorial http://www.asp.net/identity/overview/ge ... ms-project with the following corrections to adjust it for using dotConnect for Oracle:
1. Skip the "Adding Identity Packages to your App" section. Instead of this, do the following:
a) install Microsoft.AspNet.Identity.Core via Manage NuGet Packages (like it was described for “Identity.E” in the original section)
b) add references to the necessary dotConnect for Oracle assemblies (by default, %installFolder% is C:\Program Files (x86)\Devart\dotConnect\Oracle\):
2. Just after the "4" step in the "Adding Web Forms to Register Users" section replace in Register.aspx.cs:
a)
with
b)
with
3. On the "6" step in the "Adding Web Forms to Register Users" section specify your Oracle connection string, for example:
1. Skip the "Adding Identity Packages to your App" section. Instead of this, do the following:
a) install Microsoft.AspNet.Identity.Core via Manage NuGet Packages (like it was described for “Identity.E” in the original section)
b) add references to the necessary dotConnect for Oracle assemblies (by default, %installFolder% is C:\Program Files (x86)\Devart\dotConnect\Oracle\):
- %installFolder%\Devart.Data.dll
- %installFolder%\Devart.Data.Oracle.dll
- %installFolder%\Web\ASP.NET Identity 2\Devart.Data.Oracle.Web.Identity.dll
2. Just after the "4" step in the "Adding Web Forms to Register Users" section replace in Register.aspx.cs:
a)
Code: Select all
using Microsoft.AspNet.Identity.EntityFramework;
Code: Select all
using Devart.Common.Web.Identity;
using Devart.Data.Oracle.Web.Identity;
using ApplicationUser = Devart.Common.Web.Identity.IdentityUser;
Code: Select all
var userStore = new UserStore<IdentityUser>();
var manager = new UserManager<IdentityUser>(userStore);
var user = new IdentityUser() { UserName = UserName.Text };
Code: Select all
var userStore = new OracleUserStore();
var manager = new UserManager<ApplicationUser>(userStore);
var user = new IdentityUser() { UserName = UserName.Text };
Code: Select all
<configuration>
<connectionStrings>
<add name="DefaultConnection" connectionString="User Id=my_user;Password=my_password;server=dboracle;direct=true;sid=orcl1120;" providerName="Devart.Data.Oracle" />
</connectionStrings>
</configuration>